Re: [PATCH v2] overlayfs.rst: clarify the scope of file locks taken through the overlay

From: Miklos Szeredi

Date: Wed Nov 18 2026 - 06:53:10 EST


On Thu, 3 Sept 2026 at 15:51, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> On Thu, Sep 3, 2026 at 3:26 PM Tao Cui <cui.tao@xxxxxxxxx> wrote:

> > +Note that file locks and leases taken on files through the overlay
> > +mount only provide mutual exclusion between tasks that access the
> > +files through the same overlay mount, and a lease taken through the
> > +overlay is broken by opens through that overlay. They do not
> > +conflict with locks taken on the same files by anything that changes
> > +the underlying filesystems directly, so file locking cannot be relied
> > +on for mutual exclusion between overlay users and such direct
> > +changes.

Locks: completely agree.

Leases: independence on overlay and backing is not guaranteed, as open
and read/write/etc. may trigger an open on the real file, which checks
for conflicting leases.

Thanks,
Miklos