Re: [PATCH v2 4/5] ovl: Support creation of whiteout files on overlayfs

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

 



On Wed, Aug 23, 2023 at 5:52 PM Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
> On Wed, 23 Aug 2023 at 16:43, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> > If we do this, then both overlay.whiteout and overlay.xattr_whiteouts
> > xattrs will be xattrs that the overlayfs driver never sets.
> > It's a precedent, but as long as it is properly documented and encoded
> > in fstests, I will be fine with it. Not sure about Miklos.
>
> Firstly I need to properly understand the proposal.  At this point I'm
> not sure what overlay.whiteout is supposed to mean.   Does it mean the
> same as a whiteout (chrdev(0,0))?  Or does it mean that overlayfs
> should not treat it as a whiteout, but instead transform that into a
> chrdev(0,0) for the top overlay to interpret as a whiteout?  Or
> something else?
>

My proposal does not involve any transformation.
It is "just" to support another format for a whiteout.
Transforming a REG or FIFO real object to CHR ovl object
will be a pain IMO and I don't see why it is needed.

Let me try again from the top:
1. ovl_path_is_whiteout() checks if either ovl_is_whiteout() (chardev(0,0))
    or regular file with "overlay.whiteout" xattr, so ovl_lookup()
will result in
    a negative dentry if either whiteout format is found at topmost layer
2. To optimize unneeded getxattr, "overlay.whiteout" xattr could be checked
    only in case the parent dir has xattr "overlay.xattr_whiteouts"
3. mkfs.composefs is responsible of creating the non-chardev whiteouts
    as well as the marking the dirs that contains them with
    "overlay.xattr_whiteouts" - overlayfs itself never does that
4. ovl_calc_d_ino() (from readdir on a merge dir) returns true if the
    the iterated dir has "overlay.xattr_whiteouts" xattr
5. That will cause ovl_cache_update_ino() to lookup the
    *overlay dentry* that will be negative (as per rule 1 above)
    if either whiteout format is found at topmost layer and that
    will cause the readdir dirent to be marked is_whiteout and
    filtered out of readdir results

* The trick for readdir is that the the per dirent DT_CHR optimization
  is traded off for a per parent dir optimization, but even the worst case
  where all directories have xattr_whiteouts, readdir is not more
  expensive than readdir with xino enabled, which is the default for
  several Linux distros

Hope this is more clear?

Thanks,
Amir.




[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