diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-24 13:49:27 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:18 -0400 |
commit | 65857d5768f7716da539933c2075d384b117812d (patch) | |
tree | fd35ec5174e52388c870c4b23bd8a3c4153ad232 /fs | |
parent | e5929f3cff05e84f20c68df235f4768920e2e89e (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/pnfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 20a1b6222ff..d737557747b 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -718,8 +718,9 @@ _pnfs_return_layout(struct inode *ino) | |||
718 | lrp = kzalloc(sizeof(*lrp), GFP_KERNEL); | 718 | lrp = kzalloc(sizeof(*lrp), GFP_KERNEL); |
719 | if (unlikely(lrp == NULL)) { | 719 | if (unlikely(lrp == NULL)) { |
720 | status = -ENOMEM; | 720 | status = -ENOMEM; |
721 | pnfs_layout_io_set_failed(lo, IOMODE_RW); | 721 | spin_lock(&ino->i_lock); |
722 | pnfs_layout_io_set_failed(lo, IOMODE_READ); | 722 | lo->plh_block_lgets--; |
723 | spin_unlock(&ino->i_lock); | ||
723 | pnfs_put_layout_hdr(lo); | 724 | pnfs_put_layout_hdr(lo); |
724 | goto out; | 725 | goto out; |
725 | } | 726 | } |