]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: rework hashtable handling in nfsd_do_file_acquire
authorJeff Layton <jlayton@kernel.org>
Tue, 4 Oct 2022 19:41:10 +0000 (15:41 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Wed, 5 Oct 2022 14:57:48 +0000 (10:57 -0400)
commit5ca146dcf1c7fca91a5691639ab12eb0bcdcf63a
treea2acbd3c6462a095ec6695265b976fbbc8596ef2
parent909b8c02f4aa79db5fc7eeff01ca8f0cf7e7fde8
nfsd: rework hashtable handling in nfsd_do_file_acquire

nfsd_file is RCU-freed, so we need to hold the rcu_read_lock long enough
to get a reference after finding it in the hash. Take the
rcu_read_lock() and call rhashtable_lookup directly.

Switch to using rhashtable_lookup_insert_key as well, and use the usual
retry mechanism if we hit an -EEXIST. Rename the "retry" bool to
open_retry, and eliminiate the insert_err goto target.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/filecache.c