From: Neil Brown <neilb@suse.de>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org, gnb@melbourne.sgi.com
Subject: Re: [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking.
Date: Thu, 12 Jun 2008 13:38:42 +1000 [thread overview]
Message-ID: <18512.39490.36187.783761@notabene.brown> (raw)
In-Reply-To: message from Jeff Layton on Tuesday June 10
On Tuesday June 10, jlayton@redhat.com wrote:
> From: Neil Brown <neilb@suse.de>
>
> This removes the BKL from the RPC service creation codepath. The BKL
> really isn't adequate for this job since some of this info needs
> protection across sleeps.
>
> Also, add some comments to try and clarify how the locking should work
> and to make it clear that the BKL isn't necessary as long as there is
> adequate locking between tasks when touching the svc_serv fields.
>
> Signed-off-by: Neil Brown <neilb@suse.de>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Thanks for proceeding with this.
As well as the fixes for this that you included in 2/5, you need this
patch as well for correctness.... Well, you need the first hunk. The
second is unrelated but probably should be fixed.
The rest all looks good.
NeilBrown
---------------------------------
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./fs/nfsd/nfssvc.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
--- .prev/fs/nfsd/nfssvc.c 2008-06-12 13:27:47.000000000 +1000
+++ ./fs/nfsd/nfssvc.c 2008-06-12 13:32:14.000000000 +1000
@@ -169,10 +169,12 @@ int nfsd_vers(int vers, enum vers_op cha
int nfsd_nrthreads(void)
{
- if (nfsd_serv == NULL)
- return 0;
- else
- return nfsd_serv->sv_nrthreads;
+ int rv = 0;
+ mutex_lock(&nfsd_mutex);
+ if (nfsd_serv)
+ rv = nfsd_serv->sv_nrthreads;
+ mutex_unlock(&nfsd_mutex);
+ return rv;
}
static int killsig; /* signal that was used to kill last nfsd */
@@ -275,7 +277,7 @@ static int nfsd_init_socks(int port)
SVC_SOCK_DEFAULTS);
if (error < 0)
lockd_down();
-}
+ }
if (error < 0)
return error;
return 0;
next prev parent reply other threads:[~2008-06-12 3:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 12:40 [PATCH 0/5] Convert knfsd to kthread API and fix startup/shutdown races (try #4) Jeff Layton
2008-06-10 12:40 ` [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
2008-06-10 12:40 ` [PATCH 2/5] knfsd: clean up nfsd filesystem interfaces Jeff Layton
2008-06-10 12:40 ` [PATCH 3/5] knfsd: remove special handling for SIGHUP Jeff Layton
2008-06-10 12:40 ` [PATCH 4/5] knfsd: convert knfsd to kthread API Jeff Layton
2008-06-10 12:40 ` [PATCH 5/5] sunrpc: remove sv_kill_signal field from svc_serv struct Jeff Layton
2008-06-10 16:24 ` [PATCH 4/5] knfsd: convert knfsd to kthread API J. Bruce Fields
2008-06-10 16:25 ` J. Bruce Fields
2008-06-10 17:06 ` Jeff Layton
2008-06-10 20:05 ` J. Bruce Fields
2008-06-10 20:19 ` Jeff Layton
2008-06-12 3:38 ` Neil Brown [this message]
2008-06-12 12:37 ` [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
2008-06-13 6:12 ` Neil Brown
2008-06-13 18:04 ` J. Bruce Fields
-- strict thread matches above, loose matches on Subject: below --
2008-06-06 15:12 [PATCH 0/5] Convert knfsd to kthread API and fix startup/shutdown races (try #3) Jeff Layton
2008-06-06 15:12 ` [PATCH 1/5] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18512.39490.36187.783761@notabene.brown \
--to=neilb@suse.de \
--cc=gnb@melbourne.sgi.com \
--cc=jlayton@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=nfsv4@linux-nfs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox