Commit 1ca4b88e authored by Kinglong Mee's avatar Kinglong Mee Committed by J. Bruce Fields

nfsd: Fix a file leak on nfsd4_layout_setlease failure

If nfsd4_layout_setlease fails, nfsd will not put ls->ls_file.

Fix commit c5c707f9 "nfsd: implement pNFS layout recalls".
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent c2227a39
...@@ -212,6 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate, ...@@ -212,6 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
BUG_ON(!ls->ls_file); BUG_ON(!ls->ls_file);
if (nfsd4_layout_setlease(ls)) { if (nfsd4_layout_setlease(ls)) {
fput(ls->ls_file);
put_nfs4_file(fp); put_nfs4_file(fp);
kmem_cache_free(nfs4_layout_stateid_cache, ls); kmem_cache_free(nfs4_layout_stateid_cache, ls);
return NULL; return NULL;
......
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