From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: Moritz Tanner <moritz.tanner@linbit.com>
Cc: Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: don't return -EINVAL for successful nested thaw
Date: Fri, 21 Aug 2026 11:47:15 +0200 [thread overview]
Message-ID: <aogeo1t6G8VBu2oF@grappa.linbit> (raw)
In-Reply-To: <20260821085451.65206-1-moritz.tanner@linbit.com>
On Fri, Aug 21, 2026 at 10:54:51AM +0200, Moritz Tanner wrote:
> This breaks bdev-initiated freezing. When a filesystem is frozen with
> FIFREEZE and additionally frozen via bdev_freeze() -- which nests by
> design, see fs_bdev_freeze() -- the subsequent bdev_thaw() receives
> -EINVAL from the holder op although its freeze reference was dropped,
> and therefore keeps bd_fsfreeze_count elevated.
The other thaw order is the same defect seen from userspace: while the
bdev freeze is still held, fsfreeze -u returns EINVAL although it did
drop its reference, and the filesystem stays frozen until the block
layer holder thaws it.
In-kernel holders get the spurious error as well, whenever a userspace
freeze is held at the same time: xfs_scrub's xchk_fsthaw() carries the
comment "This should always succeed, we have a kernel freeze", and
f2fs_ioc_gc_range() hands the error to userspace.
Tested-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Reviewed-by: Lars Ellenberg <lars.ellenberg@linbit.com>
prev parent reply other threads:[~2026-08-21 9:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 8:54 [PATCH] fs: don't return -EINVAL for successful nested thaw Moritz Tanner
2026-08-21 9:47 ` Lars Ellenberg [this message]
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=aogeo1t6G8VBu2oF@grappa.linbit \
--to=lars.ellenberg@linbit.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=moritz.tanner@linbit.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