Re: [PATCH v3 2/5] ovl: relax same fs constrain for constant st_ino

Miklos Szeredi
2017-06-02T12:27:27Z

On Fri, Jun 2, 2017 at 8:32 AM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Thu, Jun 1, 2017 at 10:55 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Thu, Jun 1, 2017 at 11:02 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>>> For the case of all layers not on the same fs, use the copy up
>>> origin st_ino/st_dev for non-dir, if we know it.
>>>
>>> This guarantied constant and persistent st_ino/st_dev for non-dir,
>>> but not system-wide uniqueness, like in the same fs case.
>>
>> I'd rather leave this until the st_dev uniqueness is sorted out. Non
>> unique st_ino/st_dev is just asking for trouble.
>>
>
> I don't mind leaving this out, but you do realize that this commit
> doesn't change st_dev/st_ino uniqueness one way or the other, right?

Depends on how you look at it.

Before the patch it was (just the non-samefs, non-directory case):

- if lower: st_ino/st_dev comes from lower
- if upper: st_ino/st_dev comes from upper

This only violates the uniqueness rule if check+use of st_ino/st_dev
races with the copy up

After the patch it's:

- if copied up: st_ino/st_dev comes from origin
- otherwise same as above

Now the uniqueness is violated for all copied up files (origin and
overlay file will have the same st_ino/st_dev pair even though they
possibly have different contents).

So that transforms a race into a permanent error, which is not good.

Thanks,
Miklos