Skip to content

Commit

Permalink
nfsd: fix refcount leak when file is unhashed after being found
Browse files Browse the repository at this point in the history
If we wait_for_construction and find that the file is no longer hashed,
and we're going to retry the open, the old nfsd_file reference is
currently leaked. Put the reference before retrying.

Fixes: c659336 ("nfsd: don't kill nfsd_files because of lease break error")
Signed-off-by: Jeff Layton <[email protected]>
Tested-by: Youzhong Yang <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
  • Loading branch information
jtlayton authored and chucklever committed Sep 1, 2024
1 parent 81a95c2 commit 8a79261
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfsd/filecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
status = nfserr_jukebox;
goto construction_err;
}
nfsd_file_put(nf);
open_retry = false;
fh_put(fhp);
goto retry;
Expand Down

0 comments on commit 8a79261

Please sign in to comment.