diff options
author | Amir Goldstein <amir73il@gmail.com> | 2021-01-06 08:52:35 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2021-01-25 15:36:27 +0100 |
commit | e567b98ce9a4b35b63c364d24828a9e5cd7a8179 (patch) | |
tree | 7c59a1e119f6e11cb195a08d7fe055857186194f /fs/nfsd/nfsctl.c | |
parent | nfsd: remove unused stats counters (diff) | |
download | linux-e567b98ce9a4b35b63c364d24828a9e5cd7a8179.tar.xz linux-e567b98ce9a4b35b63c364d24828a9e5cd7a8179.zip |
nfsd: protect concurrent access to nfsd stats counters
nfsd stats counters can be updated by concurrent nfsd threads without any
protection.
Convert some nfsd_stats and nfsd_net struct members to use percpu counters.
The longest_chain* members of struct nfsd_net remain unprotected.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index f6d5d783f4a4..258605ee49b8 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1534,7 +1534,9 @@ static int __init init_nfsd(void) retval = nfsd4_init_pnfs(); if (retval) goto out_free_slabs; - nfsd_stat_init(); /* Statistics */ + retval = nfsd_stat_init(); /* Statistics */ + if (retval) + goto out_free_pnfs; retval = nfsd_drc_slab_create(); if (retval) goto out_free_stat; @@ -1554,6 +1556,7 @@ out_free_lockd: nfsd_drc_slab_free(); out_free_stat: nfsd_stat_shutdown(); +out_free_pnfs: nfsd4_exit_pnfs(); out_free_slabs: nfsd4_free_slabs(); |