]> www.infradead.org Git - nvme.git/commit
nfsd: fix oops when reading pool_stats before server is started
authorJeff Layton <jlayton@kernel.org>
Mon, 17 Jun 2024 11:54:08 +0000 (07:54 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 17 Jun 2024 14:13:59 +0000 (10:13 -0400)
commit8e948c365d9c10b685d1deb946bd833d6a9b43e0
treee546dd6976ad09b5d738bc5a2e52aede76f6cb4c
parent4a77c3dead97339478c7422eb07bf4bf63577008
nfsd: fix oops when reading pool_stats before server is started

Sourbh reported an oops that is triggerable by trying to read the
pool_stats procfile before nfsd had been started. Move the check for a
NULL serv in svc_pool_stats_start above the mutex acquisition, and fix
the stop routine not to unlock the mutex if there is no serv yet.

Fixes: 7b207ccd9833 ("svc: don't hold reference for poolstats, only mutex.")
Reported-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/svc_xprt.c