From: Greg Banks <gnb-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org,
Jeff Layton <jlayton@redhat.com>
Subject: Re: [PATCH 1/4] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking.
Date: Fri, 06 Jun 2008 09:35:51 +1000 [thread overview]
Message-ID: <48487857.4030706@melbourne.sgi.com> (raw)
In-Reply-To: <20080605200358.GB5829@fieldses.org>
J. Bruce Fields wrote:
> On Thu, Jun 05, 2008 at 10:47:37AM +1000, Greg Banks wrote:
>
>> I notice there's no change to write_leasetime(). That calls
>> nfs4_reset_lease(), which seems to want to only be called when nfsd is
>> not started (according to my reading of the comment preceding the
>> function), and which uses the BKL to protect the variable
>> user_lease_time. Perhaps that path should be changed to use the new
>> nfsd_mutex also?
>>
>
> write_leasetime() just results in setting the user_lease_time, which is
> copied (once, on server startup) to lease_time, which is what is
> actually used by the running server.
Yes, understood.
> So I don't think there's a race
> here (and the existing BKL use in write_leasetime() isn't really
> needed).
>
The race is pretty harmless. The only read of user_lease_time happens
during the critical section currently guarded by the BKL in nfsd_svc();
the only write of the variable is not guarded by that lock. If you call
write_leasetime() many times with different values during nfsd startup,
the actual value used is not predictable and you can't tell from
userspace whether your write() succeeded in changing the behaviour of
the server or not. Also, you can do write_leasetime() after nfsd
startup without useful effect; other parameters which can't be changed
from /proc after the service is running will fail the write() with EBUSY.
--
Greg Banks, P.Engineer, SGI Australian Software Group.
The cake is *not* a lie.
I don't speak for SGI.
next prev parent reply other threads:[~2008-06-05 23:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 15:03 [PATCH 0/4] Convert knfsd to kthread API and fix startup/shutdown races (try #2) Jeff Layton
2008-06-04 15:03 ` [PATCH 1/4] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking Jeff Layton
2008-06-04 15:03 ` [PATCH 2/4] knfsd: remove special handling for SIGHUP Jeff Layton
2008-06-04 15:03 ` [PATCH 3/4] knfsd: convert knfsd to kthread API Jeff Layton
2008-06-04 15:03 ` [PATCH 4/4] sunrpc: remove unneeded field from svc_serv struct Jeff Layton
2008-06-05 1:30 ` Greg Banks
2008-06-05 1:28 ` [PATCH 3/4] knfsd: convert knfsd to kthread API Greg Banks
2008-06-05 0:59 ` [PATCH 2/4] knfsd: remove special handling for SIGHUP Greg Banks
2008-06-04 21:02 ` [PATCH 1/4] knfsd: Replace lock_kernel with a mutex for nfsd thread startup/shutdown locking J. Bruce Fields
2008-06-04 21:27 ` Jeff Layton
[not found] ` <20080604172752.31686797-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-06-04 21:58 ` J. Bruce Fields
2008-06-04 22:41 ` J. Bruce Fields
2008-06-05 0:07 ` Jeff Layton
2008-06-05 0:47 ` Greg Banks
2008-06-05 20:03 ` J. Bruce Fields
2008-06-05 20:15 ` Jeff Layton
2008-06-05 23:35 ` Greg Banks [this message]
[not found] ` <48487857.4030706-cP1dWloDopni96+mSzHFpQC/G2K4zDHf@public.gmane.org>
2008-06-06 15:05 ` 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=48487857.4030706@melbourne.sgi.com \
--to=gnb-cp1dwlodopni96+mszhfpqc/g2k4zdhf@public.gmane.org \
--cc=bfields@fieldses.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.