Re: [PATCH 00/12] fs: take freeze protection for writes to backing files

From: Christian Brauner

Date: Sat Nov 14 2026 - 08:04:32 EST


On Sat, Nov 14, 2026 at 01:31:27PM +0100, Amir Goldstein wrote:
> On Sat, Nov 14, 2026 at 11:47:07AM +0100, Christian Brauner wrote:
> > While testing the pseudo filesystem series I noticed that zloop, the
> > nvme target's file backend and the fileio backend of the scsi target
> > with fd_async_io=1 call ->write_iter() of their backing files without
> > taking freeze protection. So their writes go straight through to a
> > frozen filesystem. ext4 complains loudly:
> >
> > WARNING: fs/ext4/ext4_jbd2.c:90 at ext4_journal_check_start+0x1f6/0x2d0
> >
> > Loop doesn't get it right for discard and write zeroes. Those end up
> > calling ->fallocate() of the backing file directly. The fileio backend
> > does the same for UNMAP. And zloop records its write pointers on flush
> > with vfs_setxattr() which leaves freeze protection to the caller. So all
> > of them modify a frozen filesystem just the same. Fix them too.
> >
> > Looking for more of the same turned up a few simple ones. coredump
> > truncates the core file, overlayfs stores its uuid xattr on mount, nfsd
> > truncates on OPEN and the BPF xattr kfuncs modify xattrs, all without
> > freeze protection. Fix those as well. The ones that need more work in
> > their subsystems I have reported separately.
> >
> > The fileio backend also frees its aio command in the completion handler
> > while the filesystem may still be using the kiocb. KASAN catches ext4
> > doing that for direct reads on v7.4-rc1. ext4 gets its own fix (cf. [1])
> > but fileio should hold a reference across the submission like loop,
> > zloop and fs/backing-file.c do.
> >
> > [1]: https://lore.kernel.org/r/20261113-work-ext4-dio_read_kiocb-v1-1-172a88be803c@xxxxxxxxxx
> >
>
> Claude says you missed another one.
> nfs_local_write_iocb_done() does not end_write
> its ended too early right after submission.

I know. There's a bunch more. These are the easy ones.
I sent individual bug reports to susbystems that need larger changes.
NFS is one of them, so is ksmbd, ecryptfs, ima and so on. :)