Re: [PATCH v4 02/15] ovl: store file handle of lower inode on copy up

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

 



On Mon, May 1, 2017 at 4:41 PM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> Sometimes it is interesting to know if an upper file is pure
> upper or a copy up target, and if it is a copy up target, it
> may be interesting to find the copy up origin.
>
> This will be used to preserve lower inode numbers across copy up.
>
> Store the lower inode file handle in upper inode extended attribute
> overlay.origin on copy up to use it later for these cases.
> Store the lower filesystem uuid along side the file handle, so we can
> validate that we are looking for the origin file in the original fs.
>
> On failure to encode lower file handle, store an invalid 'null' handle,
> so we can always use the overlay.origin xattr to distinguish between
> a copy up and a pure upper inode.
>
> If lower fs does not support NFS export ops or if not all layers are
> on the same fs, don't try to encode a lower file handle and store the
> 'null' handle instead.
>
> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
> ---
[...]
> @@ -316,6 +417,14 @@ static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir,
>         if (err)
>                 goto out_cleanup;
>
> +       /*
> +        * Store identifier of lower inode in upper inode xattr to
> +        * allow lookup of the copy up origin inode.
> +        */
> +       err = ovl_set_origin(dentry, temp);

calls setxattr - should be inside the temp->d_inode code block

> +       if (err)
> +               goto out_cleanup;
> +



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux