Commit 6c0483db authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:

 - Due to a late review, revert and re-fix a recent crasher fix

* tag 'nfsd-6.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  Revert "nfsd: fix oops when reading pool_stats before server is started"
  nfsd: initialise nfsd_info.mutex early.
parents cd63a278 ac03629b
...@@ -2169,6 +2169,8 @@ static __net_init int nfsd_net_init(struct net *net) ...@@ -2169,6 +2169,8 @@ static __net_init int nfsd_net_init(struct net *net)
nn->nfsd_svcstats.program = &nfsd_program; nn->nfsd_svcstats.program = &nfsd_program;
nn->nfsd_versions = NULL; nn->nfsd_versions = NULL;
nn->nfsd4_minorversions = NULL; nn->nfsd4_minorversions = NULL;
nn->nfsd_info.mutex = &nfsd_mutex;
nn->nfsd_serv = NULL;
nfsd4_init_leases_net(nn); nfsd4_init_leases_net(nn);
get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key)); get_random_bytes(&nn->siphash_key, sizeof(nn->siphash_key));
seqlock_init(&nn->writeverf_lock); seqlock_init(&nn->writeverf_lock);
......
...@@ -672,7 +672,6 @@ int nfsd_create_serv(struct net *net) ...@@ -672,7 +672,6 @@ int nfsd_create_serv(struct net *net)
return error; return error;
} }
spin_lock(&nfsd_notifier_lock); spin_lock(&nfsd_notifier_lock);
nn->nfsd_info.mutex = &nfsd_mutex;
nn->nfsd_serv = serv; nn->nfsd_serv = serv;
spin_unlock(&nfsd_notifier_lock); spin_unlock(&nfsd_notifier_lock);
......
...@@ -1421,13 +1421,12 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos) ...@@ -1421,13 +1421,12 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos)
dprintk("svc_pool_stats_start, *pidx=%u\n", pidx); dprintk("svc_pool_stats_start, *pidx=%u\n", pidx);
if (!si->serv)
return NULL;
mutex_lock(si->mutex); mutex_lock(si->mutex);
if (!pidx) if (!pidx)
return SEQ_START_TOKEN; return SEQ_START_TOKEN;
if (!si->serv)
return NULL;
return pidx > si->serv->sv_nrpools ? NULL return pidx > si->serv->sv_nrpools ? NULL
: &si->serv->sv_pools[pidx - 1]; : &si->serv->sv_pools[pidx - 1];
} }
...@@ -1459,8 +1458,7 @@ static void svc_pool_stats_stop(struct seq_file *m, void *p) ...@@ -1459,8 +1458,7 @@ static void svc_pool_stats_stop(struct seq_file *m, void *p)
{ {
struct svc_info *si = m->private; struct svc_info *si = m->private;
if (si->serv) mutex_unlock(si->mutex);
mutex_unlock(si->mutex);
} }
static int svc_pool_stats_show(struct seq_file *m, void *p) static int svc_pool_stats_show(struct seq_file *m, void *p)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment