ZFS Union

Teske, Devin Devin.Teske at fisglobal.com
Fri Jun 14 19:01:24 UTC 2013


On Jun 14, 2013, at 11:51 AM, Kirk McKusick wrote:

The union filesystem uses "whiteout" to remove files that appear
in a lower layer. In your example, when you `rm /vm/unit1/foo'
what happens is that a whiteout entry gets created for /vm/unit1/foo.
(Whiteout is implemented by creating a name with inode number 1;
Inode 1 is the "anti-inode" which when combined with any other inode
disappears in a cloud of greasy smoke.)

WINO… yes… just as your response came in, I was finding the code…

http://svnweb.freebsd.org/base/head/sys/ufs/ufs/ufs_lookup.c?r1=156418&r2=160269

  if (ep->d_ino == 0 ||
-     (ep->d_ino == WINO &&
+     (ep->d_ino == WINO && namlen == dirp->d_namlen &&
       bcmp(ep->d_name, dirp->d_name, dirp->d_namlen) == 0)) {




Thus /vm/master/foo continues
to exist and is visible as /vm/unit2/foo and /vm/unit3/foo. You can
"recover" /vm/unit1/foo using `rm -W /vm/unit1/foo' which will remove
the whiteout entry causing /vm/master/foo to once again be visible
as /vm/unit1/foo.

Beautiful… that was my next consternation after seeing that it was in the filesystem layer (how to reset the value from WINO to something that will allow the lower layer to bleed through).


In short, I believe that the existing union filesystem
will do what you want to do.

Kirk McKusick

Absolutely right… thank you much Sir!

I didn't know about "rm -W" until today.
--
Devin

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.


More information about the freebsd-fs mailing list