aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <[email protected]>2016-12-06 15:50:06 -0500
committerTrond Myklebust <[email protected]>2016-12-07 13:41:58 -0500
commit7a0566b38c518e98df2359c8c15c2b3f91a4d67e (patch)
treeb9f8b4da6db0aaed61dd46f5d96f84e660143479
parent362fb578a573adeb67aa4790d901d851b8f8c8f3 (diff)
NFSv4: Add missing nfs_put_lock_context()
Otherwise the lock context won't be freed when we're done with it. From: NeilBrown <[email protected]> Fixes: 5bd3f817 ("NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of lock_owner") Signed-off-by: Anna Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
-rw-r--r--fs/nfs/nfs4proc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4fd0e2b7b08e..d3431ff32662 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2955,8 +2955,10 @@ static int _nfs4_do_setattr(struct inode *inode,
l_ctx = nfs_get_lock_context(ctx);
if (IS_ERR(l_ctx))
return PTR_ERR(l_ctx);
- if (nfs4_select_rw_stateid(ctx->state, FMODE_WRITE, l_ctx,
- &arg->stateid, &delegation_cred) == -EIO)
+ status = nfs4_select_rw_stateid(ctx->state, FMODE_WRITE, l_ctx,
+ &arg->stateid, &delegation_cred);
+ nfs_put_lock_context(l_ctx);
+ if (status == -EIO)
return -EBADF;
} else
nfs4_stateid_copy(&arg->stateid, &zero_stateid);