Re: [RFC 12/26] ext2 white-out support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Josef Sipek
Date: Wednesday, August 1, 2007 - 11:44 am

On Wed, Aug 01, 2007 at 10:23:29AM -0500, Dave Kleikamp wrote:
 
Alright not the greatest of examples, there is something to be said about
symmetry, so...let me try again :)

/a/
/b/bar		(whiteout for bar)
/c/foo/qwerty

Now, let's mount a union of {a,b,c}, and we'll see:

$ find /u
/u
/u/foo
/u/foo/qwerty
$ mv /u/foo /u/bar

Now what? How do you rename? Do you rename in the same branch (assuming it
is rw)? If you do, you'll get:

$ find /u
/u

Oops! There's a whiteout in /b that hides the directory in /c -- rename(2)
shouldn't make directory subtrees disappear.

There are two ways to solve this:

1) "cp -r" the entire subtree being renamed to highest-priority branch, and
rename there (you might have to recreate a series of directories to have a
place to "cp" to...so you got "cp -r" _AND_ "mkdir -p"-like code in the VFS!
1/2 a :) )

2) Don't store whiteouts within branches. This makes it really easy to
rename and remove the whiteout.

Sure, you could try to rename in-place and remove the whiteout, but what if
you have:

/a/
/b/bar		(whiteout)
/c/bar/blah
/d/foo/qwerty

$ mv /u/foo /u/bar

You can't just remove the whiteout, because that'd uncover the whited-out
directory bar in /c.

Josef 'Jeff' Sipek.

-- 
Bad pun of the week: The formula 1 control computer suffered from a race
condition
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC 12/26] ext2 white-out support, Jan Blunck, (Mon Jul 30, 9:13 am)
Re: [RFC 12/26] ext2 white-out support, Theodore Tso, (Mon Jul 30, 8:45 pm)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Tue Jul 31, 12:44 am)
Re: [RFC 12/26] ext2 white-out support, Andreas Dilger, (Tue Jul 31, 1:32 am)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Tue Jul 31, 2:08 am)
Re: [RFC 12/26] ext2 white-out support, Theodore Tso, (Tue Jul 31, 3:53 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Tue Jul 31, 9:36 am)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Tue Jul 31, 10:00 am)
Re: [RFC 12/26] ext2 white-out support, Mark Williamson, (Tue Jul 31, 10:03 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Tue Jul 31, 10:11 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Tue Jul 31, 10:16 am)
Re: [RFC 12/26] ext2 white-out support, Hans-Peter Jansen, (Wed Aug 1, 3:00 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Wed Aug 1, 4:43 am)
Re: [RFC 12/26] ext2 white-out support, Dave Kleikamp, (Wed Aug 1, 8:23 am)
Re: [RFC 12/26] ext2 white-out support, Jan Engelhardt, (Wed Aug 1, 10:58 am)
Re: [RFC 12/26] ext2 white-out support, Jan Engelhardt, (Wed Aug 1, 11:01 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Wed Aug 1, 11:03 am)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Wed Aug 1, 11:44 am)
Re: [RFC 12/26] ext2 white-out support, Dave Kleikamp, (Wed Aug 1, 12:10 pm)
Re: [RFC 12/26] ext2 white-out support, Josef Sipek, (Wed Aug 1, 12:33 pm)
Re: [RFC 12/26] ext2 white-out support, Dave Kleikamp, (Wed Aug 1, 12:52 pm)
Re: [RFC 12/26] ext2 white-out support , Erez Zadok, (Wed Aug 1, 3:06 pm)
Re: [RFC 12/26] ext2 white-out support, Ph. Marek, (Wed Aug 1, 10:24 pm)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Thu Aug 2, 3:26 am)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Thu Aug 2, 4:55 am)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Thu Aug 2, 5:05 am)
Re: [RFC 12/26] ext2 white-out support, Jan Blunck, (Thu Aug 2, 5:12 am)
Re: [RFC 12/26] ext2 white-out support, Jörn, (Thu Aug 2, 10:50 am)
Re: [RFC 12/26] ext2 white-out support, Jeremy Maitin-Shepard, (Thu Aug 2, 11:15 am)
Re: [RFC 12/26] ext2 white-out support, Pavel Machek, (Thu Aug 2, 12:31 pm)