Skip to content

Commit b680cb9

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: add some comments to nfsd_file_do_acquire
David Howells mentioned that he found this bit of code confusing, so sprinkle in some comments to clarify. Reported-by: David Howells <dhowells@redhat.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent c659336 commit b680cb9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/nfsd/filecache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,11 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
10941094
rcu_read_unlock();
10951095

10961096
if (nf) {
1097+
/*
1098+
* If the nf is on the LRU then it holds an extra reference
1099+
* that must be put if it's removed. It had better not be
1100+
* the last one however, since we should hold another.
1101+
*/
10971102
if (nfsd_file_lru_remove(nf))
10981103
WARN_ON_ONCE(refcount_dec_and_test(&nf->nf_ref));
10991104
goto wait_for_construction;

0 commit comments

Comments
 (0)