Forwarded: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in null_process_zoned_cmd

syzbot posted 1 patch 1 month ago
There is a newer version of this series
Forwarded: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in null_process_zoned_cmd
Posted by syzbot 1 month ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] [fs?] BUG: sleeping function called from invalid context in null_process_zoned_cmd
Author: chenglingfei@foxmail.com

#syz test

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index f8c0fd57e041..0dc7fd106db8 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1912,6 +1912,12 @@ static int null_validate_conf(struct nullb_device *dev)
 		dev->blocking = true;
 	else /* cache is meaningless */
 		dev->cache_size = 0;
+
+	if (dev->shared_tags && dev->blocking && !g_blocking) {
+		pr_info("shared_tags disabled: memory_backed/blocking device requires per-device tag set for BLK_MQ_F_BLOCKING\n");
+		dev->shared_tags = false;
+	}
+
 	dev->cache_size = min_t(unsigned long, ULONG_MAX / 1024 / 1024,
 						dev->cache_size);
 	dev->mbps = min_t(unsigned int, 1024 * 40, dev->mbps);