[Devel] [PATCH vz10] ovl: release the upperdir/workdir in-use locks before the umount sync
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Fri Nov 6 18:20:58 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> The in-use locks on upperdir and workdir are released by ovl_free_fs()
> from ->put_super(). generic_shutdown_super() calls sync_filesystem()
> before that, and ovl_sync_fs() syncs the whole upper filesystem, so the
> locks stay held across a journal commit and a cache flush of the upper
> fs after the overlay is gone. With index=on a new overlay that uses the
> same upperdir, or uses it as a lowerdir, fails to mount in that window:
>
> overlayfs: upperdir is in-use as upperdir/workdir of another mount,
> mount with '-o index=off' to override exclusive upperdir protection.
>
> Userspace hits this when the last reference is not dropped by umount(2)
> itself. Docker with the containerd snapshotter mounts a snapshot on a
> thread with a private mount namespace for docker cp and for buildkit,
> [ ... ]
> Fixes: 2cac0c00a6cd ("ovl: get exclusive ownership on upper/work dirs")
> Cc: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
> Cc: Konstantin Khorenko <khorenko at virtuozzo.com>
> Feature: fix ms/overlayfs
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261106151641.3980601-1-den@openvz.org?part=1
More information about the Devel
mailing list