File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2236,19 +2236,25 @@ static __net_init int nfsd_net_init(struct net *net)
22362236 retval = nfsd_stat_counters_init (nn );
22372237 if (retval )
22382238 goto out_repcache_error ;
2239+
22392240 memset (& nn -> nfsd_svcstats , 0 , sizeof (nn -> nfsd_svcstats ));
22402241 nn -> nfsd_svcstats .program = & nfsd_program ;
2242+ if (!nfsd_proc_stat_init (net )) {
2243+ retval = - ENOMEM ;
2244+ goto out_proc_error ;
2245+ }
22412246 nn -> nfsd_versions = NULL ;
22422247 nn -> nfsd4_minorversions = NULL ;
22432248 nn -> nfsd_info .mutex = & nfsd_mutex ;
22442249 nn -> nfsd_serv = NULL ;
22452250 nfsd4_init_leases_net (nn );
22462251 get_random_bytes (& nn -> siphash_key , sizeof (nn -> siphash_key ));
22472252 seqlock_init (& nn -> writeverf_lock );
2248- nfsd_proc_stat_init (net );
22492253
22502254 return 0 ;
22512255
2256+ out_proc_error :
2257+ percpu_counter_destroy_many (nn -> counter , NFSD_STATS_COUNTERS_NUM );
22522258out_repcache_error :
22532259 nfsd_idmap_shutdown (net );
22542260out_idmap_error :
Original file line number Diff line number Diff line change @@ -115,11 +115,11 @@ void nfsd_stat_counters_destroy(struct nfsd_net *nn)
115115 nfsd_percpu_counters_destroy (nn -> counter , NFSD_STATS_COUNTERS_NUM );
116116}
117117
118- void nfsd_proc_stat_init (struct net * net )
118+ struct proc_dir_entry * nfsd_proc_stat_init (struct net * net )
119119{
120120 struct nfsd_net * nn = net_generic (net , nfsd_net_id );
121121
122- svc_proc_register (net , & nn -> nfsd_svcstats , & nfsd_proc_ops );
122+ return svc_proc_register (net , & nn -> nfsd_svcstats , & nfsd_proc_ops );
123123}
124124
125125void nfsd_proc_stat_shutdown (struct net * net )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ void nfsd_percpu_counters_reset(struct percpu_counter *counters, int num);
1515void nfsd_percpu_counters_destroy (struct percpu_counter * counters , int num );
1616int nfsd_stat_counters_init (struct nfsd_net * nn );
1717void nfsd_stat_counters_destroy (struct nfsd_net * nn );
18- void nfsd_proc_stat_init (struct net * net );
18+ struct proc_dir_entry * nfsd_proc_stat_init (struct net * net );
1919void nfsd_proc_stat_shutdown (struct net * net );
2020
2121static inline void nfsd_stats_rc_hits_inc (struct nfsd_net * nn )
You can’t perform that action at this time.
0 commit comments