From: Al Viro <viro@ZenIV.linux.org.uk>
To: Erez Zadok <ezk@cs.sunysb.edu>
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
hch@infradead.org, viro@ftp.linux.org.uk,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
mhalcrow@us.ibm.com
Subject: Re: [UNIONFS] 00/29 Unionfs and related patches pre-merge review (v2)
Date: Sat, 26 Jan 2008 08:45:32 +0000 [thread overview]
Message-ID: <20080126084532.GG27894@ZenIV.linux.org.uk> (raw)
In-Reply-To: <200801260508.m0Q58UpV031448@agora.fsl.cs.sunysb.edu>
On Sat, Jan 26, 2008 at 12:08:30AM -0500, Erez Zadok wrote:
> > * lock_parent(): who said that you won't get dentry moved
> > before managing to grab i_mutex on parent? While we are at it,
> > who said that you won't get dentry moved between fetching d_parent
> > and doing dget()? In that case parent could've been _freed_ before
> > you get to dget().
>
> OK, so looks like I should use dget_parent() in my lock_parent(), as I've
> done elsewhere. I'll also take a look at all instances in which I get
> dentry->d_parent and see if a d_lock is needed there.
dget_parent() doesn't deal with the problem of rename() done directly
in that layer while you'd been waiting for i_mutex.
> > + lock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
> > + err = vfs_rename(lower_old_dir_dentry->d_inode, lower_old_dentry,
> > + lower_new_dir_dentry->d_inode, lower_new_dentry);
> > + unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
> >
> > Uh-huh... To start with, what guarantees that your lower_old_dentry
> > is still a child of your lower_old_dir_dentry?
>
> We dget/dget_parent the old/new dentry and parents a few lines above
> (actually, it looked like I forgot to dget(lower_new_dentry) -- fixed).
And? Having a reference to dentry does not prevent it being moved
elsewhere by direct rename(2) in that layer. It will exist, that
much is guaranteed by grabbing a reference. However, there is no
warranties whatsoever that by the time you get i_mutex on what had
once been its parent, it will still remain the parent of our dentry.
> BTW, my sense of the relationship b/t upper and lower objects and their
> validity in a stackable f/s, is that it's similar to the relationship b/t
> the NFS client and server -- the client can't be sure that a file on the
> server doesn't change b/t ->revalidate and ->op (hence nfs's reliance on dir
> mtime checks).
You are thinking about non-interesting case. _Files_ are not much
of a problem. Directory tree is. The real problems with all unionfs and
stacking implementations I've seen so far, all way back to Heidemann et.al.
start when topology of the underlying layer changes. If you have clear
semantics for unionfs behaviour in presence of such things, by all means,
publish it - as far as I know *nobody* had done that; not even on the
"what should we see when..." level, nevermind the implementation.
> Perhaps this general topic is a good one to discuss at more length at LSF?
> Suggestions are welcome.
It would; I honestly do not know if the problem is solvable with the
(lack of) constraints you apparently want. Again, the real PITA begins
when you start dealing with pieces of underlying trees getting moved
around, changing parents, etc. Cross-directory rename() certainly rates
very high on the list of "WTF had they been smoking in UCB?" misfeatures,
but it's there and it has to be dealt with.
BTW, and that's a completely unrelated story, I'd rather see whiteouts
done directly by filesystems involved - it would simplify the life big
way. How about adding a dir->i_op->whiteout(dir, dentry) and seeing if
your variant could be turned into such a method to be used by really
piss-poor filesystems? All UFS-related ones (including ext*) can trivially
support whiteouts without any PITA; adding them to tmpfs is also not a big
deal and anything that caches inode type in directory entries should be
easy to extend in the same way as ext*/ufs...
next prev parent reply other threads:[~2008-01-26 8:45 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 14:59 [UNIONFS] 00/29 Unionfs and related patches pre-merge review (v2) Erez Zadok
2008-01-10 14:59 ` [PATCH 01/29] Unionfs: documentation Erez Zadok
2008-01-10 14:59 ` [PATCH 02/29] VFS/eCryptfs: use simplified fs_stack API to fsstack_copy_attr_all Erez Zadok
2008-01-10 14:59 ` [PATCH 03/29] Makefile: hook to compile unionfs Erez Zadok
2008-01-10 14:59 ` [PATCH 04/29] Unionfs: main Makefile Erez Zadok
2008-01-10 14:59 ` [PATCH 05/29] Unionfs: fanout header definitions Erez Zadok
2008-01-10 14:59 ` [PATCH 06/29] Unionfs: main header file Erez Zadok
2008-01-10 14:59 ` [PATCH 07/29] Unionfs: common file copyup/revalidation operations Erez Zadok
2008-01-10 14:59 ` [PATCH 08/29] Unionfs: basic file operations Erez Zadok
2008-01-10 14:59 ` [PATCH 09/29] Unionfs: lower-level copyup routines Erez Zadok
2008-01-10 14:59 ` [PATCH 10/29] Unionfs: dentry revalidation Erez Zadok
2008-01-10 14:59 ` [PATCH 11/29] Unionfs: lower-level lookup routines Erez Zadok
2008-01-10 14:59 ` [PATCH 12/29] Unionfs: rename method and helpers Erez Zadok
2008-01-10 14:59 ` [PATCH 13/29] Unionfs: directory reading file operations Erez Zadok
2008-01-10 14:59 ` [PATCH 14/29] Unionfs: readdir helper functions Erez Zadok
2008-01-10 14:59 ` [PATCH 15/29] Unionfs: readdir state helpers Erez Zadok
2008-01-10 14:59 ` [PATCH 16/29] Unionfs: inode operations Erez Zadok
2008-01-10 14:59 ` [PATCH 17/29] Unionfs: unlink/rmdir operations Erez Zadok
2008-01-10 14:59 ` [PATCH 18/29] Unionfs: address-space operations Erez Zadok
2008-01-10 14:59 ` [PATCH 19/29] Unionfs: mount-time and stacking-interposition functions Erez Zadok
2008-01-10 14:59 ` [PATCH 20/29] Unionfs: super_block operations Erez Zadok
2008-01-10 14:59 ` [PATCH 21/29] Unionfs: extended attributes operations Erez Zadok
2008-01-10 14:59 ` [PATCH 22/29] Unionfs: async I/O queue Erez Zadok
2008-01-10 14:59 ` [PATCH 23/29] Unionfs: miscellaneous helper routines Erez Zadok
2008-01-10 14:59 ` [PATCH 24/29] Unionfs: debugging infrastructure Erez Zadok
2008-01-10 14:59 ` [PATCH 25/29] Unionfs file system magic number Erez Zadok
2008-01-10 14:59 ` [PATCH 26/29] Unionfs: common header file for user-land utilities and kernel Erez Zadok
2008-01-10 14:59 ` [PATCH 27/29] VFS path get/put ops used by Unionfs Erez Zadok
2008-01-10 14:59 ` [PATCH 28/29] VFS: export release_open_intent symbol Erez Zadok
2008-01-10 14:59 ` [PATCH 29/29] Put Unionfs and eCryptfs under one layered filesystems menu Erez Zadok
2008-01-10 15:08 ` [UNIONFS] 00/29 Unionfs and related patches pre-merge review (v2) Christoph Hellwig
2008-01-10 15:57 ` Erez Zadok
2008-01-16 21:21 ` Michael Halcrow
2008-01-16 21:41 ` Erez Zadok
2008-01-17 6:00 ` Al Viro
2008-01-17 6:17 ` Erez Zadok
2008-01-26 5:08 ` Erez Zadok
2008-01-26 8:45 ` Al Viro [this message]
2008-02-02 18:45 ` Erez Zadok
2008-02-02 20:45 ` Al Viro
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=20080126084532.GG27894@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=ezk@cs.sunysb.edu \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhalcrow@us.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@ftp.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