Re: [PATCH v2 00/10] ovl: only sync what was written through the overlay
From: Josef Bacik
Date: Wed Nov 04 2026 - 12:38:42 EST
On Mon, Nov 2, 2026 at 11:14 AM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> I think this is over engineering.
>
> What is our goal here?
>
> Make overlayfs behave better for the (many) containers use case.
>
> Who in their right mind uses a host filesystem which is not one of the
> big three?
I mean I'm good to say if you use something other than the big three
you're on your own. I built it out this way because I assumed my
attitude of "I only care about 3 file systems" wasn't acceptable, I'm so
happy to find I was wrong.
> Please consider the attached patch.
I put it at the front of the series and dropped the fake inodes and the
hooks in the ovl_do_*() helpers. It's 8 patches now, yours and v2's 1-6
and 10, and we only track dirty inodes with fsync=relaxed. I'll send
that as v3 once my tests finish.
> The heuristics do not always get it right, for example, ext4 without
> journal does
> support RENAME_WHITEOUT, but it not safe for fsync=relaxed mode, but
> this is an imaginary scenario that nobody uses and there is config/module/mount
> options to force the legacy fsync=on mode in that case.
This one actually works, as long as we keep doing the last step of
sync_filesystem() as well. Without a journal ext4 puts all of its
metadata straight into the buffers of the block device, and
->write_inode() does nothing. So ->sync_fs() isn't enough, but
->sync_fs() + sync_blockdev() is, which is what the last patch does. I
ran my crash tests on it, whiteouts, index entries and the work
directory all make it to disk. I added "and write its block device" to
your sentence in overlayfs.rst. Thanks,
Josef