Re: [PATCH v5] ovl: Check link ability between upperdir and workdir

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

 



在 2018年4月4日,下午5:30,Miklos Szeredi <miklos@xxxxxxxxxx> 写道:
> 
> On Sun, Apr 1, 2018 at 7:56 AM, cgxu519@xxxxxxx <cgxu519@xxxxxxx> wrote:
>> 在 2018年3月29日,下午8:54,Miklos Szeredi <miklos@xxxxxxxxxx> 写道:
>>> 
>>> On Sat, Jan 20, 2018 at 7:32 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>>>> On Sat, Jan 20, 2018 at 6:10 PM, Chengguang Xu <cgxu519@xxxxxxxxxx> wrote:
>>>>> Inspired by encountering unexpected write error with
>>>>> error code -EXDEV when upperdir and workdir having
>>>>> different project quotas. The reason of the error is
>>>>> project quota asks files in it strictly inherit
>>>>> project id of it’s own, so rename/link operations
>>>>> between those directories will fail and it may cause
>>>>> failure during copy-up/index-link operations in overlayfs.
>>>>> 
>>>>> So if upper filesystem supports O_TMPFILE, try to check
>>>>> link ability between upperdir and workdir and if check
>>>>> fails, print a proper warning message to indicate potential
>>>>> possibility of write failure.
>>>>> 
>>>>> The failure of the check does not directly lead to
>>>>> read-only mounting because in some use cases may only
>>>>> write to upperdir and do not modify anything in lowerdirs.
>>> 
>>> Thinking about a bit more: this assumes that mounter has create
>>> permission under upper layer root.  That assumption would be true in
>>> ordinary setups.  But if we break that assumption and deny create in
>>> the root of the upper layer, we could still have a perfectly working
>>> setup (as long as there's no need to copy-up anything in that
>>> directory).
>> 
>> Isn’t it similar to the check which upperdir and workdir must be in same filesystem?
>> If we set project quota then the related directories will behave like sub-filesystem.
> 
> 
> I agree with that.
> 
> What I'm saying is that your implementation may give a false positive
> (i.e. warning on an otherwise perfectly working setup).
> 
> Worse yet, it may change the result of the tmpfile test in such a
> case, which is a regression.
> 
> So I think the implementation needs to be rethought.

So maybe back to compare project ids is better? If we want to accurately recognize
the condition we also need to check inherit flag in inode and that check depends on
underlying filesystems, we can build supporting infrastructure for that but I’m not
sure if it is worth.



Thanks,
Chengguang.


--
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