summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-24 17:49:27 (GMT)
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 20:03:18 (GMT)
commit65857d5768f7716da539933c2075d384b117812d (patch)
treefd35ec5174e52388c870c4b23bd8a3c4153ad232
parente5929f3cff05e84f20c68df235f4768920e2e89e (diff)
downloadlinux-65857d5768f7716da539933c2075d384b117812d.tar.xz
NFSv4.1: _pnfs_return_layout() shouldn't invalidate the layout on failure
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>
-rw-r--r--fs/nfs/pnfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 20a1b62..d737557 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -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;
}