aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-12-13 09:11:39 -0500
committerJ. Bruce Fields <bfields@redhat.com>2015-01-07 13:38:21 -0500
commit94ae1db226a5bcbb48372d81161f084c9e283fd8 (patch)
tree696ef809d14d51b48112195e06dbf7bd599807c4 /fs
parentb1940cd21c0f4abdce101253e860feff547291b0 (diff)
nfsd: fix fi_delegees leak when fi_had_conflict returns true
Currently, nfs4_set_delegation takes a reference to an existing delegation and then checks to see if there is a conflict. If there is one, then it doesn't release that reference. Change the code to take the reference after the check and only if there is no conflict. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3550a9c87616..c06a1ba80d73 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3897,11 +3897,11 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
3897 status = nfs4_setlease(dp); 3897 status = nfs4_setlease(dp);
3898 goto out; 3898 goto out;
3899 } 3899 }
3900 atomic_inc(&fp->fi_delegees);
3901 if (fp->fi_had_conflict) { 3900 if (fp->fi_had_conflict) {
3902 status = -EAGAIN; 3901 status = -EAGAIN;
3903 goto out_unlock; 3902 goto out_unlock;
3904 } 3903 }
3904 atomic_inc(&fp->fi_delegees);
3905 hash_delegation_locked(dp, fp); 3905 hash_delegation_locked(dp, fp);
3906 status = 0; 3906 status = 0;
3907out_unlock: 3907out_unlock: