Skip to content

Commit 1ca4b88

Browse files
kinglongmeeJ. Bruce Fields
authored andcommitted
nfsd: Fix a file leak on nfsd4_layout_setlease failure
If nfsd4_layout_setlease fails, nfsd will not put ls->ls_file. Fix commit c5c707f "nfsd: implement pNFS layout recalls". Signed-off-by: Kinglong Mee <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent c2227a3 commit 1ca4b88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfsd/nfs4layouts.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
212212
BUG_ON(!ls->ls_file);
213213

214214
if (nfsd4_layout_setlease(ls)) {
215+
fput(ls->ls_file);
215216
put_nfs4_file(fp);
216217
kmem_cache_free(nfs4_layout_stateid_cache, ls);
217218
return NULL;

0 commit comments

Comments
 (0)