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

From: Oleg Nesterov

Date: Thu Sep 03 2026 - 09:00:56 EST


On 09/03, Karl Mehltretter wrote:
>
> Record whether a successful freeze acquired the writer rwsems and use that
> state during thaw instead of re-sampling SB_RDONLY.

Looks correct at first glance, but I leave this to other reviewers,
I don't understand fs/ enough.

> Tested with a test-only KUnit case in x86_64 QEMU on linux-next
> 32b6ef9a5d0e (next-20260902). It freezes a writable ramfs, sets SB_RDONLY,
> thaws it, and calls sb_start_write_trylock(). The call fails without this
> patch and succeeds with it.

But I am curious, how exactly did you test this?

ramfs_ops doesn't have ->freeze_fs or ->freeze_super, so
ioctl_fsfreeze() should fail?

And how it is possible to remount with -ro, reconfigure_super() should
see sb->s_writers.frozen != SB_UNFROZEN ?

Oleg.