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

From: Oleg Nesterov

Date: Thu Sep 03 2026 - 17:44:11 EST


On 09/03, Karl Mehltretter wrote:
>
> On Thu, Sep 03, 2026 at 02:44:19PM +0100, Oleg Nesterov wrote:
> > > 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 ?
> >
> Hi Oleg,
>
> Thank you for the review!
>
> The original test called freeze_super() directly, changed SB_RDONLY,
> and called thaw_super().

Thanks, but this doesn't answer my questions...

How exactly this original test "called freeze_super() directly" ?
Could you show this test-case ?

IOW, how can we actually hit the problems described in the changelog?

Let me repeat, you can safely ignore me, I don't understand fs/,
I am just curious.

Oleg.