From: Trond Myklebust Date: Mon, 24 Sep 2012 17:49:27 +0000 (-0400) Subject: NFSv4.1: _pnfs_return_layout() shouldn't invalidate the layout on failure X-Git-Tag: next-20120926~99^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=be49de305972753bdd1ffb5ec85ca74de939620a;p=karo-tx-linux.git 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 --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 28f71268a07a..4aeebb94b054 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; }