From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 00/13] overlay filesystem: request for inclusion (v16) Date: Thu, 14 Mar 2013 22:59:40 +0000 Message-ID: <20130314225940.GQ21522@ZenIV.linux.org.uk> References: <1363102908-28956-1-git-send-email-miklos@szeredi.hu> <20130312222350.GK21522@ZenIV.linux.org.uk> <20130313185249.GL21522@ZenIV.linux.org.uk> <20130313231918.GP21522@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , linux-fsdevel , Linux Kernel Mailing List , Christoph Hellwig , Andrew Morton , Robo Bot , Felix Fietkau , Neil Brown , Jordi Pujol , ezk@fsl.cs.sunysb.edu, David Howells , Sedat Dilek , "J. R. Okajima" To: Miklos Szeredi Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Mar 14, 2013 at 11:37:50AM +0100, Miklos Szeredi wrote: > > As for whiteouts... I think we ought to pull these bits of unionmoun > > queue into the common stem and add the missing filesystems to them; > > ext* and ufs are trivial (keep in mind that FFS derivatives, including > > ext*, have d_type in directory entry and type 14 (DT_WHT) is there > > precisely for that purpose). btrfs also has "dir_type" thing - 8bit > > field... > > What about userspace interfaces? Are we allowed to extend d_type and > st_mode without breaking things? Huh? * from st_mode point of view, it's not going to conflict with anything; FFS "entry type" matches bits 12..15 of mode_t, and the value picked by whoever had first implemented whiteouts had been chosen so that it would not clash with any existing values. We have #define S_IFMT 00170000 #define S_IFSOCK 0140000 #define S_IFLNK 0120000 #define S_IFREG 0100000 #define S_IFBLK 0060000 #define S_IFDIR 0040000 #define S_IFCHR 0020000 #define S_IFIFO 0010000 and this sucker would've been 0160000; new filesystem object types are not frequently introduced, to put it mildly, so I wouldn't expect clashes. Especially since any such clash would hit Solaris and *BSD (including MacOS X) as well - all of them use that value for whiteouts. * for practically all syscalls these guys are treated as file not being there; e.g. mkdir() on such name results in whiteout silently replaced with references to newly created subdirectory, etc. * BSDs have one major exposure of those guys to userland - their getdents(2) shows whiteouts (with d_type equal to DT_WHT and d_fileno - to 1). Other than that (and we obviously do _not_ want that as default behaviour; maybe a new O_ to produce that), there's practically nothing - undelete(2) removes a whiteout in attempt to expose the object masked by it, mknod(2) with S_IFWHT as type does create one. That's it. IOW, I don't see how we'd get any kind of userland problems with those. And this is not a new API - a bunch of BSD-derived Unices starting with, IIRC, SunOS 3 and 4.3BSD, as well as their bastard progeny (Solaris, MacOS X) had that since mid-80s...