diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2015-07-09 17:38:26 +0800 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-07-20 14:58:22 -0400 |
commit | 1ca4b88e7de23f6f86d2009101fe42d5b9dbf3de (patch) | |
tree | 999d7832f8e06ec7b6fbf255f30998952feeae0c /fs/nfsd | |
parent | c2227a39a078473115910512aa0f8d53bd915e60 (diff) | |
download | linux-1ca4b88e7de23f6f86d2009101fe42d5b9dbf3de.tar.gz linux-1ca4b88e7de23f6f86d2009101fe42d5b9dbf3de.tar.bz2 linux-1ca4b88e7de23f6f86d2009101fe42d5b9dbf3de.zip |
nfsd: Fix a file leak on nfsd4_layout_setlease failure
If nfsd4_layout_setlease fails, nfsd will not put ls->ls_file.
Fix commit c5c707f96f "nfsd: implement pNFS layout recalls".
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4layouts.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 6904213a4363..ebf90e487c75 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c @@ -212,6 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate, BUG_ON(!ls->ls_file); if (nfsd4_layout_setlease(ls)) { + fput(ls->ls_file); put_nfs4_file(fp); kmem_cache_free(nfs4_layout_stateid_cache, ls); return NULL; |