Re: [PATCH v4] ovl: mark xwhiteouts directory with overlay.opaque='x'

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

 



On Tue, 23 Jan 2024 at 10:53, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> On Tue, Jan 23, 2024 at 11:05 AM Alexander Larsson <alexl@xxxxxxxxxx> wrote:

> I think it does not because:
>
>     ovl_layer_set_xwhiteouts() is called before adding the overlay dir
>     dentry to dcache, while readdir of that same directory happens
>     after the overlay dir dentry is in dcache, so if some cpu observes
>     ovl_dentry_is_xwhiteouts(), it will also observe layer->has_xwhiteouts
>     for the layers where xwhiteouts marker was found in that merge dir.
>
> I hope I got this right (Miklos?).

I agree with the above analysis.  There's a possibility of false
positives since it just checks the intersection of the layer flag with
that of the dentry flag, and in case of false positives there's no
serialization.  But that doesn't matter.

The true positive case is indeed serialized by the initial lookup
setting both flags, hence checking the intersection is guaranteed to
yield positive.

Thanks,
Miklos


> I added this non-trivial comment above ovl_layer_set_xwhiteouts().
>
> > Anyway:
> >
> > Reviewed-by: Alexander Larsson <alexl@xxxxxxxxxx>
> > Tested-by: Alexander Larsson <alexl@xxxxxxxxxx>
> >
>
> Pushed to ovl-fixes.
> Pending ACK from Miklos.
>
> 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