Date: Mon, 04 Oct 2004 08:38:20 +0200 From: Uwe Doering <gemini@geminix.org> To: David Schultz <das@FreeBSD.ORG> Cc: freebsd-current@FreeBSD.ORG Subject: Re: Your CVS fix 1.109 to union_vnops.c Message-ID: <4160EFDC.90609@geminix.org> In-Reply-To: <20041004061829.GB11422@VARK.MIT.EDU> References: <20041004053106.GQ88303@vertex.kz> <200410040606.i9466UVm012207@sana.init-main.com> <20041004061829.GB11422@VARK.MIT.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
David Schultz wrote: > On Mon, Oct 04, 2004, Takanori Watanabe wrote: > >>In message <20041004053106.GQ88303@vertex.kz>, Boris Popov wrote: >> >>>On Sun, Oct 03, 2004 at 11:06:42PM +0200, Uwe Doering wrote: >>> >>>>>That isn't the issue. The issue is that an application might open >>>>>the vnode in the unionfs mount, and another application might >>>>>modify the same file in the underlying file system. If the kernel >>>>>doesn't understand that it is really the same file, then cache >>>>>incoherencies will occur. I'm actually not sure to what extent >>>>>this is a problem already; John Heidemann's Phd thesis had a way >>>>>of dealing with it, but FreeBSD doesn't do things that way AFAIK. >>>> >>>>Okay, but that's a different matter. What I was addressing at the start >>>>of this discussion is an ambiguity issue with meta data, that is, >>>>information that ends up in stat(2) and friends. >>> >>> Exactly, one never knows what parts of metadata used by applications. >>>I can confirm that ino are ought to be unique inside filesystem, otherwise >>>some programs will fail in a very obscure ways. >> >>Ok, the issue Uwe says is when underlying filesystem and >>wrapping filesystem are diffent and if there are two files >>with same identifier exists. >>And the issue I want to fix is when underlying filesystem and >>wrapping filesystem are same so getcwd routine failed to distinguish >>the mount point. >> >>So it can be solved by translating fsid if the fsid of a file is same as >>that of mountpoint. True? > > Many applications use the file's inode number and the filesystem > device number to uniquely identify files, since this information > can be easily and portably extracted via stat(2). IIRC, unionfs > has always used the upper layer's device number, which is arguably > wrong. Not exactly. If the underlying file is in the upper layer, the va_fsid/va_fileid fields of the upper layer are returned. If the file resides in the lower layer, va_fsid/va_fileid come from that layer. If there is a file in both the upper and lower layer, the upper layer's meta data is returned. Which is correct as well because in this case the file in the lower layer is completely ignored as far as data retrieval and modification are concerned. Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4160EFDC.90609>