NFSv4.1: _pnfs_return_layout() shouldn't invalidate the layout on failure
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 24 Sep 2012 17:49:27 +0000 (13:49 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Sep 2012 20:03:18 +0000 (16:03 -0400)
Failure of the layoutreturn allocation fails is not a good reason to
mark the pnfs_layout_hdr as having failed a layoutget or i/o. Just
exit cleanly.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/pnfs.c

index 20a1b6222ff689b0317683f06c9cd05c7fa0bfaa..d737557747b91b82947ec2d1e9552a35d9fb9419 100644 (file)
@@ -718,8 +718,9 @@ _pnfs_return_layout(struct inode *ino)
        lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
        if (unlikely(lrp == NULL)) {
                status = -ENOMEM;
-               pnfs_layout_io_set_failed(lo, IOMODE_RW);
-               pnfs_layout_io_set_failed(lo, IOMODE_READ);
+               spin_lock(&ino->i_lock);
+               lo->plh_block_lgets--;
+               spin_unlock(&ino->i_lock);
                pnfs_put_layout_hdr(lo);
                goto out;
        }
This page took 0.042852 seconds and 5 git commands to generate.