linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <vaurora@redhat.com>
To: hooanon05@yahoo.co.jp
Cc: Jan Blunck <jblunck@suse.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Andy Whitcroft <apw@canonical.com>,
	Scott James Remnant <scott@canonical.com>,
	Sandu Popa Marius <sandupopamarius@gmail.com>,
	Jan Rekorajski <baggins@sith.mimuw.edu.pl>,
	Arnd Bergmann <arnd@arndb.de>,
	Vladimir Dronnikov <dronnikov@gmail.com>,
	Felix Fietkau <nbd@openwrt.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] Union mounts/writable overlays design
Date: Sat, 10 Oct 2009 21:43:39 -0400	[thread overview]
Message-ID: <20091011014339.GB12667@shell> (raw)
In-Reply-To: <15604.1254497442@jrobl>

On Sat, Oct 03, 2009 at 12:30:42AM +0900, hooanon05@yahoo.co.jp wrote:
> 
> Hi,
> 
> Valerie Aurora:
> > Writable overlays (formerly union mounts)
> > =========================================
> > 
> > In this document:
> >  - Overview of writable overlays
> >  - Terminology
> >  - VFS implementation
> 	:::
> 
> While I don't remember exactly when I first read the source files of
> UnionMount, I think it is promising. And I have written to Val and Jan
> some of my comments or reviews about UnionMount.
> Recently I noticed another issue about stat(2) and mountpoint(1). The
> latter is a part of 'initscripts' package.
> 
> For example,
> - you have a union-ed directory, /u = /rw + /ro
> - /ro/usr dir exists
> - /rw/usr dir does NOT exist
> - of course, /u/usr exists
> 
> As far as I know, UnionMount is expected to handle /u/usr directory
> as if it exists under /u dir.
> (I may be wrong since it totally depends upon the design of UnionMount)
> 
> In this case, stat(2) for /u and /u/usr will return different st_dev
> from each other. eg. stat(/u/usr) returns the st_dev value of /ro,
> stat(/u) returns the one for /rw.
> 
> This behaviour may make /bin/mountpoint confused, particulary in the
> chroot/switch_root-ed environment.
> /bin/mountpoint issues stat(2) for the specified dir and its parent, and
> compares their st_dev. If they differ from each other, the utility
> handles the specified dir as a "mountpoint". I am afraid it will make
> some init-scripts crazy because /u/usr is NOT a mountpoint actually.

In writable overlays, every directory will be copied up to the top
writable overlay, so /u and /u/usr will both have the same st_dev.
The copy up happens on lookup, so a stat() will trigger this copy up.
A directory and a regular file in it will have different st_dev's,
though.  Can you foresee any problems with that?

Thanks again,

-VAL

> One possible solution will be setting a hook to vfs_stat(), which
> handles the vfsmount set UNION flag differently and returns the pseudo
> st_dev for the entires in UnionMount. But it may lead to the duplicated
> inode number situation which may make applications crazy.
> For instance,
> - /ro/fileA is hardlinked to /ro/fileB.
> - the inode number of them is i100.
> - /rw/fileC is handlinked to /rw/fileD.
> - the inode number of them is i100 too.
> 
> Since /ro and /rw are different, the same inode number is not a
> problem natively. But if UnionMount takes an approach above, they all
> have the same st_dev value. And I am afraid some applications may
> handle them as a single hardlink unexpectedly.
> 
> So UnionMount should maintain its inode numbers by itself?
> No, it goes to the filesystem-type implementation. It should not be the
> way of UnionMount.
> Are there any ideas to solve this problem?
> 
> 
> J. R. Okajima
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-10-11  1:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 14:55 [RFC] Union mounts/writable overlays design Valerie Aurora
2009-10-01 15:47 ` kevin granade
     [not found] ` <7004b08e0910010838i6d0a5f5xeed699be686f6906@mail.gmail.com>
2009-10-01 17:15   ` Valerie Aurora
2009-10-01 17:55     ` Jan Blunck
2009-10-01 20:08       ` kevin granade
2009-10-02 19:15         ` Valerie Aurora
2009-10-01 18:49 ` Brad Boyer
2009-10-02 15:30 ` hooanon05
2009-10-11  1:43   ` Valerie Aurora [this message]
2009-10-12  5:19     ` hooanon05

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=20091011014339.GB12667@shell \
    --to=vaurora@redhat.com \
    --cc=apw@canonical.com \
    --cc=arnd@arndb.de \
    --cc=baggins@sith.mimuw.edu.pl \
    --cc=dronnikov@gmail.com \
    --cc=hch@infradead.org \
    --cc=hooanon05@yahoo.co.jp \
    --cc=jblunck@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd@openwrt.org \
    --cc=sandupopamarius@gmail.com \
    --cc=scott@canonical.com \
    --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;
as well as URLs for NNTP newsgroup(s).