Re: Multiple lower layers - presedence?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux