summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Halevy <benny@tonian.com>2011-06-15 11:39:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-06-15 11:52:15 -0400
commit1ed3a8539af7b36aa5c977f304e80f7fc8d27bfc (patch)
tree2e4f96dccc79f57a9afb0cd0bc89add38d311d94
parentc7fd06228b994190d8369a2a0acf5224e4e13d1a (diff)
downloadop-kernel-dev-1ed3a8539af7b36aa5c977f304e80f7fc8d27bfc.zip
op-kernel-dev-1ed3a8539af7b36aa5c977f304e80f7fc8d27bfc.tar.gz
NFSv4.1: need to put_layout_hdr on _pnfs_return_layout error path
We always get a reference on the layout header and we rely on nfs4_layoutreturn_release to put it. If we hit an allocation error before starting the rpc proc we bail out early without dereferncing the layout header properly. Signed-off-by: Benny Halevy <benny@tonian.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/pnfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index d066aad..8f95822 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -652,6 +652,7 @@ _pnfs_return_layout(struct inode *ino)
lrp = kzalloc(sizeof(*lrp), GFP_KERNEL);
if (unlikely(lrp == NULL)) {
status = -ENOMEM;
+ put_layout_hdr(lo);
goto out;
}
OpenPOWER on IntegriCloud