Re: [PATCH] super: remember whether freeze holds writer rwsems

From: Karl Mehltretter

Date: Thu Sep 03 2026 - 16:00:50 EST


On Thu, Sep 03, 2026 at 12:40:42PM +0100, Jan Kara wrote:
> This looks like one of these theoretical issues LLMs come up with. Frankly,
> I just wouldn't bother. If the fs gets forcibly remounted RO due to
> metadata errors, a frozen fs is likely the least of your worries.
>

You may be right that this is not worth fixing in generic VFS. I tried the
real filesystem paths anyway:

Without patch With patch
ext2 next write hangs, unmount write and unmount complete
gives three RCU warnings
NILFS2 unmount gives three unmount completes cleanly
RCU warnings

These tests use FIFREEZE, FITHAW, and corrupted filesystem images.
Other filesystems have similar error paths.

The f2fs report fixed by 930c6ab93492 exercised the same sequence. The ext4
change d3476f3dad4a removed the analogous SB_RDONLY assignment because it
confused filesystem freezing.

The VFS patch only makes thaw release what freeze acquired. It is needed
because these filesystems change SB_RDONLY outside the remount path.

Should I send a v2 with the changelog limited to the reproduced failure,
look at filesystem-specific fixes, or leave this alone?

Thanks,
Karl