Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2013 19:01:11 +0000
From:      "Teske, Devin" <Devin.Teske@fisglobal.com>
To:        Kirk McKusick <mckusick@mckusick.com>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>, Devin Teske <dteske@freebsd.org>
Subject:   Re: ZFS Union 
Message-ID:  <13CA24D6AB415D428143D44749F57D7201F81A60@ltcfiswmsgmb21>
In-Reply-To: <201306141851.r5EIpkl2054401@chez.mckusick.com>
References:  <201306141851.r5EIpkl2054401@chez.mckusick.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13CA24D6AB415D428143D44749F57D7201F81A60>