Re: [nfsv4] RFC 7530: Filehandle of opened file after the REMOVE

Bruce James Fields <> Thu, 29 December 2016 02:47 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4C78A129793 for <>; Wed, 28 Dec 2016 18:47:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -5.002
X-Spam-Status: No, score=-5.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-3.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 7vZeq3gtAoMU for <>; Wed, 28 Dec 2016 18:47:04 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 70C0E12953B for <>; Wed, 28 Dec 2016 18:47:04 -0800 (PST)
Received: by (Postfix, from userid 2815) id F0A543F4; Wed, 28 Dec 2016 21:47:03 -0500 (EST)
Date: Wed, 28 Dec 2016 21:47:03 -0500
From: Bruce James Fields <>
To: Trond Myklebust <>
Message-ID: <>
References: <> <> <> <> <> <> <> <> <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: <>
Cc: IETF NFSv4 WG Mailing List <>
Subject: Re: [nfsv4] RFC 7530: Filehandle of opened file after the REMOVE
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NFSv4 Working Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 29 Dec 2016 02:47:05 -0000

On Tue, Dec 27, 2016 at 09:24:36PM +0100, Trond Myklebust wrote:
> Sure, but in order to be reboot safe, you need to go well beyond the
> functionality that you describe. As far as I can tell, you need to
> defer the garbage collection that would normally occur when the server
> comes back up again until after the state reclaim has occurred (as you
> describe below).

I never seriously worked on it, but for a while I was in the habit of
running it by people.  Christoph Hellwig thought it was doable (I think
he suggested some sort of callback from the filesystem during the
garbage collection, possibly because he had in mind some other
application for that--but my memory may be wrong).  Chris Mason didn't
like the idea at all.  He asked what we expect to happen on fsck, or if
the filesystem gets mounted without nfs getting started, or... some
other scenarios I forget.

We could do the same silly rename tricks on the server side.  Something
like: create a directory with an unlikely name in the root of the
export, rename files there on REMOVE.  Possible problems:

	- you'll never be able to completely hide that directory.  But
	  maybe we could get some sort of filesystem support for a
	  hidden directory.
	- what if the remove is from a non-nfs user?  Maybe we could get
	  some kind of notification on unlink of an open file, maybe we
	  just live with continuing not to handle this particular case.
	- I guess we need to tell nfs users that the inode's link count
	  is zero?  (Any local users will still see it as one, though?)