* [PATCH] NFSv4: Add missing nfs_put_lock_context()
@ 2016-12-06 20:50 Anna.Schumaker
0 siblings, 0 replies; only message in thread
From: Anna.Schumaker @ 2016-12-06 20:50 UTC (permalink / raw)
To: Trond.Myklebust, linux-nfs; +Cc: Anna.Schumaker, neilb
From: NeilBrown <neilb@suse.com>
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: Anna Schumaker <Anna.Schumaker@netapp.com>
---
fs/nfs/nfs4proc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f992281..21c861a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2951,8 +2951,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);
--
2.10.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-06 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 20:50 [PATCH] NFSv4: Add missing nfs_put_lock_context() Anna.Schumaker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).