Re: [PATCH] ext4: make concurrent DEFAULT shutdown waits killable
From: diasyzhangqing
Date: Tue Nov 10 2026 - 22:28:44 EST
On Tue 10-11-26 21:35:56, Jan Kara wrote:
> Err, no. This is really syzkaller self-inflicted damage we aren't going to
> work around. If anything you could make the wait on bd_fsfreeze_mutex
> in bdev_freeze() killable. That will actually be a sensible change and
> should address syzbot warning as well.
Thanks, that's indeed simpler. All current callers of bdev_freeze()
(the generic FIFREEZE ioctl, ext4, ntfs, ntfs3, xfs) already propagate
the error, so only the wait itself needs to change:
---
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
block/bdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/bdev.c b/block/bdev.c
index f20f91b3176e..e57be2320423 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -301,7 +301,9 @@ int bdev_freeze(struct block_device *bdev)
{
int error = 0;
- mutex_lock(&bdev->bd_fsfreeze_mutex);
+ error = mutex_lock_killable(&bdev->bd_fsfreeze_mutex);
+ if (error)
+ return error;
/* A device being removed from its filesystem refuses freezes. */
if (!atomic_inc_unless_negative(&bdev->bd_fsfreeze_count)) {
--
2.43.7