All of lore.kernel.org
 help / color / mirror / Atom feed
From: hujianyang <hujianyang@huawei.com>
To: intrigeri <intrigeri@boum.org>, fabian.sturm@aduu.de
Cc: linux-unionfs@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: Multiple lower layers - presedence?
Date: Wed, 7 Jan 2015 10:22:35 +0800	[thread overview]
Message-ID: <54AC986B.6030100@huawei.com> (raw)
In-Reply-To: <85r3v799yw.fsf@boum.org>

On 2015/1/6 23:59, intrigeri wrote:
> Hi,
> 
> Fabian Sturm wrote (05 Jan 2015 01:29:04 GMT) :
>> Consider the case /lower1/A and /lower2/A exist.
>> What is part of the api - that it is undefined or that one takes presedence 
>> over the other?
>> It would be nice to have this clarified in the documentation.
> 
> IMO this should be specified. I would intuitively believe that
> a right-hand lowerdir should take precedence over any left-hand one,
> but my intuition definitely is tainted by cultural background that not
> everyone shares, so it's probably worth looking at how it's done in
> aufs, to make migration easier for aufs users.

Hi,

It seems different in overlayfs. A left-hand lowerdir take precedence
over any right-hand one in the option line.

For example, we have two file with same name in two lower directories.

/mnt/ext4/lower1 # echo lower1 > file
/mnt/ext4/lower2 # echo lower2 > file

and mount them in different order.

/mnt # mount -t overlay overlay -o lowerdir=./ext4/lower1/:./ext4/lower2/ ./overlay
/mnt # cat ./overlay/file
lower1

/mnt # mount -t overlay overlay -o lowerdir=./ext4/lower2/:./ext4/lower1/ ./overlay
/mnt # cat ./overlay/file
lower2

It is because lowerdirs are store in a buffer which is scanned by mount
function of overlayfs from left to right. The left most one is treat as
the top most lowerdir and the right most lowerdir is treat as the lowest
lowerdir.

I think a definition about this is needed in the documentation.

Thanks,
Hu


  reply	other threads:[~2015-01-07  2:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-05  1:00 Multiple lower layers - presedence? Fabian Sturm
2015-01-05  1:29 ` Fabian Sturm
2015-01-06 15:59   ` intrigeri
2015-01-07  2:22     ` hujianyang [this message]
2015-01-08 14:10       ` Miklos Szeredi

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=54AC986B.6030100@huawei.com \
    --to=hujianyang@huawei.com \
    --cc=fabian.sturm@aduu.de \
    --cc=intrigeri@boum.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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.