All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	"Jeff Layton" <jlayton@redhat.com>,
	"Cláudio Martins" <ctpm@ist.utl.pt>,
	"Ian Munsie" <imunsie@au1.ibm.com>,
	linux-nfs <linux-nfs@vger.kernel.org>,
	"Scott Romanowski" <romansc@us.ibm.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Subject: Re: NFS sillyrename side effect
Date: Thu, 21 Oct 2010 19:50:12 +0200	[thread overview]
Message-ID: <4CC07D54.7070204@panasas.com> (raw)
In-Reply-To: <1287495168.2969.9.camel@heimdal.trondhjem.org>

On 2010-10-19 15:32, Trond Myklebust wrote:
> On Tue, 2010-10-19 at 08:40 +0200, Benny Halevy wrote:
>> On 2010-10-18 19:10, J. Bruce Fields wrote:
>>> On Mon, Oct 18, 2010 at 11:01:38AM -0400, Jeff Layton wrote:
>>>> On Mon, 18 Oct 2010 15:53:44 +0100
>>>> Cláudio Martins <ctpm@ist.utl.pt> wrote:
>>>>
>>>>>
>>>>> On Mon, 18 Oct 2010 15:48:11 +0100 Cláudio Martins <ctpm@ist.utl.pt> wrote:
>>>>>>
>>>>>>  Section D2 ends with:
>>>>>>
>>>>>> "The NFS version 4 protocol is stateful, and could actually support
>>>>>> delete-on-last-close. Unfortunately there isn't an easy way to do this
>>>>>> and remain backwards-compatible with version 2 and 3 accessors."
>>>>>>
>>>>>>  So, theoretically, could one modify the code to selectively disable
>>>>>> silly rename on a client, when it knows it is talking v4 with the
>>>>>> server?
>>>>>>
>>>>>
>>>>>  BTW, to clarify, I'm assuming a scenario where the server is
>>>>> configured to talk v4 only, which I suspect should be common, at least
>>>>> when you're relying on v4 kerberos security.
>>>>>
>>>>
>>>> Sadly, no...
>>>>
>>>> The server does generally hold the file open as long as the client has
>>>> the file open. So, you could delete the file while nfsd has it open and
>>>> everything would probably still work.
>>>>
>>>> Suppose though that the server crashes and reboots. When it comes back
>>>> up, fsck figures out that the file has been unlinked and frees the
>>>> blocks on the disk. Now you can't reclaim the state on the open file.
>>>>
>>>> We're pretty much stuck with silly-renaming even for v4.
>>>
>>> The server could do something like rename the file into a special
>>> directory somewhere 
>>
>> The clients can do something similar too, like sillyrenaming the
>> files onto <mountpoint>/.unlinked_while_opened.<client-id>
>> Removing this directory when it empties.
> 
> This would require access, directory create, and delete permissions for
> the directory '<mountpoint>/', which is not always a given.

Correct. But that's pretty easy to probe :)

> 
> Besides, what if the server reboots, and my clientid changes?

By <client-id> I meant a unique identifier for the client, not necessarily
the nfsv4.x clientid.  The client could just as well use its ip address
(to help admins deal with the aftermath in case the client goes away) and its
boot time, or even a random string.

Benny

> 
> Trond

  reply	other threads:[~2010-10-21 17:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18  1:20 NFS sillyrename side effect Ian Munsie
2010-10-18 14:10 ` Jeff Layton
2010-10-18 14:48   ` Cláudio Martins
2010-10-18 14:53     ` Cláudio Martins
2010-10-18 15:01       ` Jeff Layton
     [not found]         ` <20101018110138.5f5001eb-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-10-18 15:44           ` Cláudio Martins
2010-10-18 16:21             ` Lyle Seaman
2010-10-18 17:00               ` Cláudio Martins
2010-10-18 17:10         ` J. Bruce Fields
2010-10-19  6:40           ` Benny Halevy
2010-10-19 13:32             ` Trond Myklebust
2010-10-21 17:50               ` Benny Halevy [this message]
2010-10-21 18:01                 ` J. Bruce Fields
2010-10-21 18:28                 ` Trond Myklebust
     [not found]   ` <20101018101059.574b715a-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-10-19  5:18     ` Ian Munsie

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=4CC07D54.7070204@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=benh@kernel.crashing.org \
    --cc=bfields@fieldses.org \
    --cc=ctpm@ist.utl.pt \
    --cc=imunsie@au1.ibm.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=romansc@us.ibm.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 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.