Commit 7a0566b3 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

NFSv4: Add missing nfs_put_lock_context()

Otherwise the lock context won't be freed when we're done with it.

From: NeilBrown <neilb@suse.com>
Fixes: 5bd3f817 ("NFSv4: change nfs4_select_rw_stateid to take a lock_context inplace of lock_owner")
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 362fb578
...@@ -2955,8 +2955,10 @@ static int _nfs4_do_setattr(struct inode *inode, ...@@ -2955,8 +2955,10 @@ static int _nfs4_do_setattr(struct inode *inode,
l_ctx = nfs_get_lock_context(ctx); l_ctx = nfs_get_lock_context(ctx);
if (IS_ERR(l_ctx)) if (IS_ERR(l_ctx))
return PTR_ERR(l_ctx); return PTR_ERR(l_ctx);
if (nfs4_select_rw_stateid(ctx->state, FMODE_WRITE, l_ctx, status = nfs4_select_rw_stateid(ctx->state, FMODE_WRITE, l_ctx,
&arg->stateid, &delegation_cred) == -EIO) &arg->stateid, &delegation_cred);
nfs_put_lock_context(l_ctx);
if (status == -EIO)
return -EBADF; return -EBADF;
} else } else
nfs4_stateid_copy(&arg->stateid, &zero_stateid); nfs4_stateid_copy(&arg->stateid, &zero_stateid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment