]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nfsd: no need get cache ref when protected by rcu
authorYang Erkun <yangerkun@huawei.com>
Wed, 25 Dec 2024 06:59:06 +0000 (14:59 +0800)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 6 Jan 2025 14:37:41 +0000 (09:37 -0500)
commitc224edca7af028828e2ad866b61d731b5e72b46d
tree5e3da1a35a8ef7246ba146f7a04f0ba68e73b8ab
parent2f55dbe4e2072c9e99298c6f37473778a98c9107
nfsd: no need get cache ref when protected by rcu

rcu_read_lock/rcu_read_unlock has already provide protection for the
pointer we will reference when we call e_show. Therefore, there is no
need to obtain a cache reference to help protect cache_head.
Additionally, the .put such as expkey_put/svc_export_put will invoke
dput, which can sleep and break rcu. Stop get cache reference to fix
them all.

Fixes: ae74136b4bb6 ("SUNRPC: Allow cache lookups to use RCU protection rather than the r/w spinlock")
Suggested-by: NeilBrown <neilb@suse.de>
Signed-off-by: Yang Erkun <yangerkun@huawei.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/export.c