linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Zach Brown <zab@redhat.com>
Subject: Re: [RFC PATCH] vfs: add permute operation
Date: Thu, 30 May 2013 12:15:38 +0200	[thread overview]
Message-ID: <CAJfpegvG2uVy6vsoGHnsjpOeR+40VVT9dAdjBs7xYYXtyYZadA@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFwmUsDW+y0k2jgF-Z0uCiTP3FrioQEwU9ue7UAJVkCDtg@mail.gmail.com>

On Thu, May 30, 2013 at 11:11 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, May 30, 2013 at 5:45 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:

>>  1) check if destination directory is empty:  upper directory contains a
>> whiteout for each lower directory entry and nothing else
>>  2) if empty then remove whiteouts in destination directory
>>  3) and then go on with the normal rename procedure, replacing the empty
>> destination directory with the source directory ,
>>
>> This is done with directory locking, so atomicity is not usually a problem.
>> But in case of a crash between 2) and 3)  we just seriously corrupted the
>> overlay.
>>
>> Suggestions for fixing that?
>
> Why not just do the NFS thing. That has worked forever - using a
> sillyrename as a "pending deletion" instead of actually deleting
> things.
>
> So in between (1) and (2), silly-rename the pseudo-empty target. At
> that point (2) is no longer even an atomicity requirement, because you
> can do the whiteout removal later. In fact, you probably want to do it
> at the end, after doing the "real" rename.

Okay, nice idea.   More specifically we want to replace the directory
containing whiteouts with an opaque empty directory, which can be done
with a cross-rename.

Then we are left with basically two new variants of rename:

  - cross rename - exchange two names
  - plain overwriting rename but whiteout source

I'm fine with that.

As for userspace interfaces I think the cross-rename is useful enough
to justify a new syscall (rename/renameat don't have flags
unfortunately).

Thanks,
Miklos

  reply	other threads:[~2013-05-30 10:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 15:33 [RFC PATCH] vfs: add permute operation Miklos Szeredi
2013-05-28 17:36 ` Zach Brown
2013-05-29  8:12   ` Miklos Szeredi
2013-05-29 23:01     ` Zach Brown
     [not found] ` <CA+55aFzTG_fU6SxWVAag-8oCDT1ozNdH96vmfDNkphLCvas-MA@mail.gmail.com>
     [not found]   ` <CAJfpeguL6psFDbS2JY3ieVCvMXAezR3vk24e1nRW+ReHXSSfdw@mail.gmail.com>
2013-05-30  9:11     ` Linus Torvalds
2013-05-30 10:15       ` Miklos Szeredi [this message]
2013-05-30 15:50       ` J. R. Okajima

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=CAJfpegvG2uVy6vsoGHnsjpOeR+40VVT9dAdjBs7xYYXtyYZadA@mail.gmail.com \
    --to=miklos@szeredi.hu \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zab@redhat.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;
as well as URLs for NNTP newsgroup(s).