All of lore.kernel.org
 help / color / mirror / Atom feed
From: hooanon05@yahoo.co.jp
To: Valerie Aurora <vaurora@redhat.com>
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, 03 Oct 2009 00:30:42 +0900	[thread overview]
Message-ID: <15604.1254497442@jrobl> (raw)
In-Reply-To: <20091001145547.GA29152@shell>


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.

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

  parent reply	other threads:[~2009-10-02 15:42 UTC|newest]

Thread overview: 11+ 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 14:55 ` 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 [this message]
2009-10-11  1:43   ` Valerie Aurora
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=15604.1254497442@jrobl \
    --to=hooanon05@yahoo.co.jp \
    --cc=apw@canonical.com \
    --cc=arnd@arndb.de \
    --cc=baggins@sith.mimuw.edu.pl \
    --cc=dronnikov@gmail.com \
    --cc=hch@infradead.org \
    --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=vaurora@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.