From: Karl Mehltretter <kmehltretter@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] super: remember whether freeze holds writer rwsems
Date: Thu, 3 Sep 2026 21:36:24 +0200 [thread overview]
Message-ID: <apnKz_3xD-zbw0dM@gmail.com> (raw)
In-Reply-To: <aplro1ObQ5YNZT6R@redhat.com>
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().
Ramfs only supplied an initialized superblock.
It did not use FIFREEZE or a normal remount.
I have now tested real filesystem error paths in x86_64 QEMU:
Filesystem Baseline this VFS patch
---------- ------------------------------- -------------------------------
ext2 write hangs after thaw, write succeeds unmount is clean
unmount gives three
rcu_sync_dtor() warnings
NILFS2 unmount gives three unmount is clean
rcu_sync_dtor() warnings
JFS write hangs in VFS rwsem is released then the
percpu_rwsem_wait() write hangs in JFS txBegin()
The ext2 and NILFS2 tests use real FIFREEZE and FITHAW and corrupted disk
metadata.
The JFS result also shows the scope of the patch. It balances the VFS rwsems,
but JFS skips txResume() after seeing SB_RDONLY. Needs JFS fix.
Karl
next prev parent reply other threads:[~2026-09-03 19:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 6:08 Karl Mehltretter
2026-09-03 10:40 ` Jan Kara
2026-09-03 19:50 ` Karl Mehltretter
2026-09-04 9:31 ` Jan Kara
2026-09-03 12:44 ` Oleg Nesterov
2026-09-03 19:36 ` Karl Mehltretter [this message]
2026-09-03 21:43 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apnKz_3xD-zbw0dM@gmail.com \
--to=kmehltretter@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®