Re: [PATCH 04/11] ovl: Provide a mount option metacopy=on/off for metadata copyup

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

 



On Wed, Oct 18, 2017 at 5:10 PM, Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:
> On Wed, Oct 18, 2017 at 07:31:51AM +0300, Amir Goldstein wrote:
>
> [..]
>> > @@ -644,9 +664,16 @@ static int ovl_lower_dir(const char *name, struct path *path,
>> >          * The inodes index feature needs to encode and decode file
>> >          * handles, so it requires that all layers support them.
>> >          */
>> > -       if (ofs->config.index && !ovl_can_decode_fh(path->dentry->d_sb)) {
>> > +       if ((ofs->config.index || ofs->config.metacopy) &&
>> > +            !ovl_can_decode_fh(path->dentry->d_sb)) {
>> > +               if (ofs->config.index)
>> > +                       pr_warn("overlayfs: fs on '%s' does not support file handles, falling back to index=off.\n", name);
>> > +
>> > +               if (ofs->config.metacopy)
>> > +                       pr_warn("overlayfs: fs on '%s' does not support file handles, falling back to metacopy=off.\n", name);
>> > +
>>
>> In my verify_dir patches I used the following more compact warning
>> style instead of granular warnings:
>>
>>     pr_warn("overlayfs: fs on '%s' does not support file handles,
>> falling back to index=off,metacopy=off.\n", name);
>
> Ok, I was not sure about it. I am fine with above style too.
>
> BTW, I have a question. Current code seems to ensure that upper/work
> supports file handles.
>
>         /* Check if upper/work fs supports file handles */
>         if (ufs->config.index &&
>                 !ovl_can_decode_fh(ufs->workdir->d_sb)) {
>                 ufs->config.index = false;
>                 pr_warn("overlayfs: upper fs does not support file handles, falling back to index=off.\n");
>         }
>
> I am wondering why that's the case and do I need it for metacopy feature
> also. I thought that file handle support requirement was only on lower
> dirs because they are the one who will export the origin file handle. All
> upper has to do it that save this file handles in an xattr.
>
> What am I missing?
>

There is a concept of an "upper origin" (see is_upper param to
ovl_verify_origin())
With current code it is only used to verify upper root is index dir origin
(i.e. index dir is not reused with a different upper dir)
This is currently the only reason that upper is required to have file
handle support.
But index is meant to serve NFS export and directory index entries (implemented
with index=all patches) also contain an ORIGIN xattr pointing to upper dir,
instead of the non-dir hardlink to upper.

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