lkml.org 
[lkml]   [2021]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [syzbot] INFO: task hung in ext4_fill_super
From
Date
On 8/5/21 5:46 PM, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any issue:
>
> Reported-and-tested-by: syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com
>
> Tested on:
>
> commit: 251a1524 Merge tag 'scsi-fixes' of git://git.kernel.or..
> git tree: upstream
> kernel config: https://syzkaller.appspot.com/x/.config?x=166c8f6532dd88df
> dashboard link: https://syzkaller.appspot.com/bug?extid=c9ff4822a62eee994ea3
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.1
> patch: https://syzkaller.appspot.com/x/patch.diff?x=160a3301300000
>
> Note: testing is done by a robot and is best-effort only.
>

#syz test
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


With regards,
Pavel Skripkin
From f31fdca900d687994a880dfd675d0a46da1eaec9 Mon Sep 17 00:00:00 2001
From: Pavel Skripkin <paskripkin@gmail.com>
Date: Fri, 6 Aug 2021 10:40:31 +0300
Subject: [PATCH] ext4: fix kthread_should_stop() while TASK_RUNNING

/* ... */

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
fs/ext4/mmp.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index bc364c119af6..fd1985b79a8d 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -183,9 +183,15 @@ static int kmmpd(void *data)
}

diff = jiffies - last_update_time;
- if (diff < mmp_update_interval * HZ)
- schedule_timeout_interruptible(mmp_update_interval *
- HZ - diff);
+ if (diff < mmp_update_interval * HZ) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (kthread_should_stop()) {
+ __set_current_state(TASK_RUNNING);
+ break;
+ }
+
+ schedule_timeout(mmp_update_interval * HZ - diff);
+ }

/*
* We need to make sure that more than mmp_check_interval
--
2.32.0
\
 
 \ /
  Last update: 2021-08-06 09:46    [W:0.061 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site