From: Jan Blunck <jblunck@suse.de>
To: bsn.0007@gmail.com
Cc: libc-alpha@sourceware.org, Erez Zadok <ezk@cs.sunysb.edu>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
viro@zeniv.linux.org.uk, Christoph Hellwig <hch@lst.de>,
Ulrich Drepper <drepper@redhat.com>,
Mingming Cao <cmm@us.ibm.com>, Dave Hansen <haveblue@us.ibm.com>,
Trond Myklebust <trond.myklebust@fys.uio.no>,
bharata@linux.vnet.ibm.com, David Woodhouse <dwmw2@infradead.org>
Subject: Re: [RFC PATCH 0/2] Union Mount: Directory listing in glibc
Date: Tue, 29 Apr 2008 18:04:31 +0200 [thread overview]
Message-ID: <20080429160431.GY30780@bolzano.suse.de> (raw)
In-Reply-To: <20080429133201.GA9938@localhost.localdomain>
On Tue, Apr 29, bsn.0007@gmail.com wrote:
> The RFC discussed about the information glibc readdir needs to get about
> union mounted directories and I have assumed the following information
> to be available from the kernel for this implementation.
>
> - Kernel would return all the dirents (including duplicates and whiteouts)
> starting from the topmost directory of the union.
>
> - Indication that this directory is a union mounted directory
> I have assumed that kernel would return a "." whiteout as the first
> directory entry of the union. This would tell glibc readdir(3) that it is
> working with a union mounted directory and it needs to do duplicate
> elimination and whiteout suppression. It starts building a dirent cache
> for this purpose.
IIRC the intention was to emit a "." whiteout when "changing" from one
directory to the next. That means when the first directory is completely read
the whiteout is emitted. After that glibc knows to start duplicate
removal.
> Ulrich had suggested that we could use the fstat call to recognize union
> mounts. But looking at the stat structure from stat(2), it was not obvious
> as to which field in there could be used for this purpose. Hence for this
> prototype implementation, I decided to go with what Al Viro suggested, which
> is about using a "." whiteout.
>
> - Indication that kernel is done with returning entries from the topmost
> directory.
> I have assumed that kernel would return a "." whiteout at the beginning
> of each directory of the union. So when glibc gets a 2nd "." whiteout, it
> will start performing duplicate elimination.
See above
> - Whiteout indication
> glibc will depend on dirent->d_type to be set to DT_WHT on a whiteout
> file.
Which makes the new filetype very much visible to the userspace but maybe that
is the price we have to pay.
> Compatibility issues
> --------------------
> There are many versions of dirent structure in glibc and I have tried my
> best to take care of compatibility issues. But I have not really tested
> readdir64 or old_readdir64. Also atleast one version of dirent structure
> doesn't have d_type field and my whiteout suppression logic depends on it
> and uses it in the generic __READDIR routine which gets used by various
> version of readdir and I think this would break that readdir version which
> uses dirent structure w/o d_type. I will be taking care of such compatibility
> issues more cleanly/thoroughly in subsequent posts.
We don't support union mounts on older kernels. Newer kernels return
d_type. So I think we don't have a problem.
Regards,
Jan
--
Jan Blunck <jblunck@suse.de>
next prev parent reply other threads:[~2008-04-29 16:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-29 13:32 bsn.0007
2008-04-29 13:33 ` [RFC PATCH 1/2] Union Mount: glibc readdir support bsn.0007
2008-05-01 6:08 ` Ulrich Drepper
2008-05-06 4:21 ` Bharata B Rao
2008-05-06 5:46 ` hooanon05
2008-05-06 13:10 ` David Newall
2008-05-12 3:43 ` Bharata B Rao
2008-05-12 3:49 ` Erez Zadok
2008-05-09 20:05 ` Erez Zadok
2008-04-29 13:34 ` [RFC PATCH 2/2] Union Mount: glibc seekdir support bsn.0007
2008-04-29 15:21 ` [RFC PATCH 0/2] Union Mount: Directory listing in glibc hooanon05
2008-04-29 16:12 ` Jan Blunck
2008-04-29 15:49 ` Erez Zadok
2008-04-29 16:16 ` Jan Blunck
2008-04-30 6:07 ` NAGABHUSHAN BS
2008-04-30 16:35 ` Erez Zadok
2008-05-01 1:39 ` hooanon05
2008-04-29 16:04 ` Jan Blunck [this message]
2008-04-30 6:18 ` NAGABHUSHAN BS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080429160431.GY30780@bolzano.suse.de \
--to=jblunck@suse.de \
--cc=bharata@linux.vnet.ibm.com \
--cc=bsn.0007@gmail.com \
--cc=cmm@us.ibm.com \
--cc=drepper@redhat.com \
--cc=dwmw2@infradead.org \
--cc=ezk@cs.sunysb.edu \
--cc=haveblue@us.ibm.com \
--cc=hch@lst.de \
--cc=libc-alpha@sourceware.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=trond.myklebust@fys.uio.no \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®