From: Michal Suchanek <hramrach@centrum.cz>
To: "J. R. Okajima" <hooanon05@yahoo.co.jp>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Valerie Aurora <val@vaaconsulting.com>,
Andrew Morton <akpm@linux-foundation.org>,
NeilBrown <neilb@suse.de>,
viro@zeniv.linux.org.uk, torvalds@linux-foundation.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
apw@canonical.com, nbd@openwrt.org, jordipujolp@gmail.com,
ezk@fsl.cs.sunysb.edu
Subject: Re: [PATCH 0/7] overlay filesystem: request for inclusion
Date: Thu, 16 Jun 2011 12:35:22 +0200 [thread overview]
Message-ID: <BANLkTimhL5BG9gHOG0Fr9U5fLkE0NJvpng@mail.gmail.com> (raw)
In-Reply-To: <18273.1308192226@jrobl>
On 16 June 2011 04:43, J. R. Okajima <hooanon05@yahoo.co.jp> wrote:
>
> Michal Suchanek:
>> This is generally not possible in solutions that don't reserve any filename=
>> s.
>>
>> However, it should be possible to create whiteout of a non-existent
>> entry in a directory while it is locked without affecting userspace.
>
> Actually aufs generates a doubly whiteouted unique name dynamically for
> the target dir. For instance, when rmdir("dirA") aufs does,
> - lock i_mutex of the parent dir of dirA on the real fs
> - some verifycations for the parent-child relationship
> - some tests whether we can do rmdir
> - create whiteout for dirA
> - rename dirA to .wh..wh.XXXXXXXX (random value in hex), after making
Probably swap the two above, you can't make a whiteout in presence of
the directory, right?
Anyway, you could just mark dirA as whiteout and remove any whiteouts
contained in it asynchronously, and only jump through these hoops when
trying to create a new entry in place of non-empty whiteout, or sync
on emptying the old whiteout before making a new entry.
> sure the name doesn't exist
> - unlock the parent dir
> - return to VFS
> And then the async workqueue removes the .wh..wh.XXXXXXXX dir with some
> whiteouts under it.
>
> It means the temporary whiteout name is,
> - always unique
> - always hidden (from users), even if it remains accidentally
> So even if an error happens in the async work, it doesn't matter.
Yes, it can only cause pollution with whiteouts unrelated to any files
that ever existed which is not too much of an issue unless people want
to add random stuff to the lower layer and see it in the union when
they reconstruct it again.
>
> Additionally there is a userspace script called "auchk" which is like
> fsck for real fs. auchk script checks the logical consistency on the
> (writable) real fs, and removes the illegal whiteouts, remained
> pseudo-links, and remained temp files.
>
>
>> As an alternative way to perform atomic renames I would suggest
>> "fallthrough symlinks". If you want to rename an entry which is
>
> Symlink?
> Is it a different thing from DCACHE_FALLTHRU in UnionMount?
Yes, the fallthru in unionmount only says "look below here", it cannot
point to a different place in the filesystem.
> I am afraid a special symlink is fragile or dangerous.
> Its special meaning is valid in inner union world only, is it? If
It is only valid when in the upper layer of a union. However, so is
whiteout, and so are files that were visible in the union but are not
visible in the top layer if examined separately, outside of the union.
It must be accepted that the top layer is different from the union,
otherwise you want a copy, not a union.
> something in outer world gets changed, we may not follow the symlink
> anymore or follow something different unexpectedly. Is it acceptable?
That' the whole idea behind symlinks, and also unions which implicitly
link the lower layer into the upper to present the result as a single
directory tree.
Anyway, the motivation behind the "fallthru symlink" is that you need
not copy-up on seemingly trivial operations like rename, touch, etc.
which both makes them more efficient and easier to get atomic. As I
understand it copy-up is the operation that causes the most issues and
with "fallthru symlinks" you need it only for operations that are
expected to modify something non-trivially.
Obviously, this is not so nice for zero sized files but they should be
handled the same way for consistency I guess. Also metada that can be
conveniently recorded on the fallthru entry would make touch fast but
would hide possible later updates to the lower layer so it might be
not good solution for all use cases. For throwaway tmpfs, however, any
optimization counts.
Seriously, the overlayfs documents that it can have opaque directories
but I don't see what they would be used for. There is no way to turn a
directory opaque with normal userspace operation afaict.
It has no explicit fallthrus, at least not documented so to have any
level of consistency it should always check the lower layer because it
can grow some new directories when the union is deconstructed, offline
modified, and reconstructed (which is supported use case according to
the docs).
Thanks
Michal
next prev parent reply other threads:[~2011-06-16 10:35 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110609125114.8dff08da.akpm@linux-foundation.org>
2011-06-10 6:57 ` Fw: Re: [PATCH 0/7] overlay filesystem: request for inclusion Valerie Aurora
2011-06-10 9:01 ` Alan Cox
2011-06-15 11:19 ` Miklos Szeredi
2011-06-15 14:32 ` J. R. Okajima
2011-06-15 15:49 ` Miklos Szeredi
2011-06-15 16:14 ` J. R. Okajima
2011-06-15 17:20 ` Michal Suchanek
2011-06-15 18:12 ` Miklos Szeredi
2011-06-16 2:43 ` J. R. Okajima
2011-06-16 10:35 ` Michal Suchanek [this message]
2011-06-16 15:15 ` J. R. Okajima
2011-06-17 7:38 ` Michal Suchanek
2011-06-20 0:43 ` J. R. Okajima
[not found] ` <803fd88dc28748428861b75afdee3575@HUBCAS1.cs.stonybrook.edu>
2011-06-16 0:44 ` Erez Zadok
2011-06-16 3:07 ` J. R. Okajima
2011-06-01 12:46 Miklos Szeredi
2011-06-08 22:32 ` Andrew Morton
2011-06-09 1:59 ` NeilBrown
2011-06-09 3:52 ` Andrew Morton
2011-06-09 12:47 ` Miklos Szeredi
2011-06-09 19:38 ` Andrew Morton
2011-06-09 19:49 ` Felix Fietkau
2011-06-09 22:02 ` Miklos Szeredi
2011-06-10 3:48 ` J. R. Okajima
2011-06-10 9:31 ` Francis Moreau
2011-06-16 18:27 ` Ric Wheeler
2011-06-10 10:19 ` Michal Suchanek
2011-06-12 7:44 ` J. R. Okajima
2011-06-13 18:48 ` Miklos Szeredi
2011-07-08 14:44 ` Miklos Szeredi
2011-07-08 15:21 ` Tomas M
2011-07-09 12:22 ` J. R. Okajima
2011-07-15 12:33 ` Miklos Szeredi
2011-07-15 13:02 ` J. R. Okajima
2011-07-15 13:04 ` J. R. Okajima
2011-07-15 13:07 ` Miklos Szeredi
2011-07-15 13:33 ` J. R. Okajima
2011-07-15 15:16 ` Miklos Szeredi
2011-06-09 13:49 ` Andy Whitcroft
2011-06-09 19:32 ` Andrew Morton
2011-06-09 19:40 ` Linus Torvalds
2011-06-09 20:17 ` Miklos Szeredi
2011-06-09 22:58 ` Anton Altaparmakov
2011-06-11 2:39 ` Greg KH
2011-06-12 20:51 ` Anton Altaparmakov
2011-06-10 11:51 ` Bernd Schubert
2011-06-10 12:45 ` Michal Suchanek
2011-06-10 12:54 ` Bernd Schubert
2011-06-09 13:57 ` Michal Suchanek
2011-06-09 13:57 ` Andy Whitcroft
2011-07-05 19:54 ` Hans-Peter Jansen
2011-07-08 12:57 ` Miklos Szeredi
2011-07-10 8:23 ` Ric Wheeler
2011-07-10 13:55 ` Sorin Faibish
2011-07-12 15:59 ` Miklos Szeredi
2011-07-10 11:16 ` Hans-Peter Jansen
2011-07-12 16:15 ` Miklos Szeredi
[not found] ` <4540f7aa16724111bd792a1d577261c2@HUBCAS1.cs.stonybrook.edu>
2011-06-16 6:51 ` Erez Zadok
2011-06-16 9:45 ` Michal Suchanek
2011-06-16 10:45 ` Jordi Pujol
2011-06-16 15:15 ` J. R. Okajima
2011-06-16 16:09 ` Miklos Szeredi
2011-06-16 22:59 ` J. R. Okajima
2011-07-08 14:40 ` Miklos Szeredi
2011-07-09 12:18 ` J. R. Okajima
2011-07-15 10:59 ` Miklos Szeredi
[not found] ` <b624059d70d546d4a4ecb940613235ab@HUBCAS2.cs.stonybrook.edu>
[not found] ` <BF42D8D9-B947-448A-8818-BCA786E75325@fsl.cs.sunysb.edu>
2011-06-16 23:41 ` J. R. Okajima
[not found] ` <ab75a25c918145569b721dea9aea5506@HUBCAS2.cs.stonybrook.edu>
[not found] ` <BF19F4F8-9E0F-4983-87C1-BB1B0A11D011@fsl.cs.sunysb.edu>
2011-06-17 1:49 ` 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=BANLkTimhL5BG9gHOG0Fr9U5fLkE0NJvpng@mail.gmail.com \
--to=hramrach@centrum.cz \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=apw@canonical.com \
--cc=ezk@fsl.cs.sunysb.edu \
--cc=hooanon05@yahoo.co.jp \
--cc=jordipujolp@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=nbd@openwrt.org \
--cc=neilb@suse.de \
--cc=torvalds@linux-foundation.org \
--cc=val@vaaconsulting.com \
--cc=viro@zeniv.linux.org.uk \
/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).