Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Benjamin Coddington <bcodding@redhat.com>,
	Jeff Layton <jlayton@kernel.org>
Cc: NeilBrown <neilb@suse.de>, Dai Ngo <dai.ngo@oracle.com>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Tom Talpey <tom@talpey.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: NFSD automatically releases all states when underlying file system is unmounted
Date: Fri, 21 Mar 2025 11:18:40 -0400	[thread overview]
Message-ID: <508ab008-866b-49b1-83cb-31d25de96f8c@oracle.com> (raw)
In-Reply-To: <5ACD599A-44FA-41B0-AFDB-B8D352044387@redhat.com>

On 3/21/25 11:07 AM, Benjamin Coddington wrote:
> On 21 Mar 2025, at 10:43, Jeff Layton wrote:
> 
>> On Fri, 2025-03-21 at 10:36 -0400, Benjamin Coddington wrote:
>>> On 20 Mar 2025, at 13:53, Chuck Lever wrote:
>>>
>>>> On 3/19/25 5:46 PM, NeilBrown wrote:
>>>>> On Thu, 20 Mar 2025, Dai Ngo wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Currently when the local file system needs to be unmounted for maintenance
>>>>>> the admin needs to make sure all the NFS clients have stopped using any files
>>>>>> on the NFS shares before the umount(8) can succeed.
>>>>>
>>>>> This is easily achieved with
>>>>>   echo /path/to/filesystem > /proc/fs/nfsd/unlock_filesystem
>>>>>
>>>>> Do this after unexporting and before unmounting.
>>>>
>>>> Seems like administrators would expect that a filesystem can be
>>>> unmounted immediately after unexporting it. Should "exportfs" be changed
>>>> to handle this extra step under the covers? Doesn't seem like it would
>>>> be hard to do, and I can't think of a use case where it would be
>>>> harmful.
>>>
>>> No. I think that admins don't expect to lose all their NFS client's state if
>>> they're managing the exports.  That would be a really big and invisible change
>>> to existing behavior.
>>>
>>
>> If we're unexporting the filesystem though, then ISTM like we ought to
>> cancel any state that was held on it. Are you concerned the admin
>> inadvertently unexporting something or is there another use-case you're
>> worried about?
> 
> I'm worried about changing existing behavior and the fallout, today I can
> un-export and re-export all day long, and as long as I re-export the
> filesystem the applications on those clients are unaffected.
> 
> I'm an old sysadmin that knows that I can un-export and re-export stuff and
> not have to worry about state loss.

Is it documented that you can rely on that? If not, then I'd say old
sysadmins should expect that behavior can be changed. 2-cents.

Also, as a sysadmin, I would never unexport and expect there to be no
consequences. Running apps that try to open a file on a recently
unexported share /will/ get ESTALE -- NFSv3 holds no open state at
all, so the next NFS READ on that share will fail with EIO.

So unexport is already not without some consequences. IMO it's not
sensible to expect an unexport / re-export cycle will be safe under all
circumstances.


> There have to be existing systems and
> people that also have that knowledge built in by now.  If we change this, we
> break things.

No lies detected. ;-)

Another reality test is to audit other server implementations. I can ask
around.


-- 
Chuck Lever

  reply	other threads:[~2025-03-21 15:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 18:22 NFSD automatically releases all states when underlying file system is unmounted Dai Ngo
2025-03-19 18:28 ` Chuck Lever
2025-03-19 19:00   ` Dai Ngo
2025-03-19 19:24     ` Chuck Lever
2025-03-19 19:44       ` Dai Ngo
2025-03-19 21:46 ` NeilBrown
2025-03-19 22:12   ` Dai Ngo
2025-03-20 17:53   ` Chuck Lever
2025-03-21 14:36     ` Benjamin Coddington
2025-03-21 14:43       ` Jeff Layton
2025-03-21 15:07         ` Benjamin Coddington
2025-03-21 15:18           ` Chuck Lever [this message]
2025-03-21 15:51             ` Benjamin Coddington
2025-03-21 14:44       ` Chuck Lever
2025-03-26  0:23         ` NeilBrown
2025-03-26  3:20           ` Dai Ngo
2025-03-26  3:41             ` NeilBrown
2025-03-26 13:15               ` Chuck Lever
2025-03-27 22:47                 ` NeilBrown
2025-04-09 21:00               ` Dai Ngo

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=508ab008-866b-49b1-83cb-31d25de96f8c@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bcodding@redhat.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /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