From: Ming Lei <ming.lei@redhat.com>
To: syzbot ci <syzbot+ci7622762f075d3fa0@syzkaller.appspotmail.com>
Cc: axboe@kernel.dk, dchinner@redhat.com, hch@lst.de,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
mpatocka@redhat.com, zhaoyang.huang@unisoc.com,
syzbot@lists.linux.dev, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot ci] Re: loop: improve loop aio perf by IOCB_NOWAIT
Date: Mon, 29 Sep 2025 09:13:34 +0800 [thread overview]
Message-ID: <aNndPs6kom-n4HSs@fedora> (raw)
In-Reply-To: <68d9818c.a00a0220.102ee.002d.GAE@google.com>
On Sun, Sep 28, 2025 at 11:42:20AM -0700, syzbot ci wrote:
> syzbot ci has tested the following series
>
> [v1] loop: improve loop aio perf by IOCB_NOWAIT
> https://lore.kernel.org/all/20250928132927.3672537-1-ming.lei@redhat.com
> * [PATCH V4 1/6] loop: add helper lo_cmd_nr_bvec()
> * [PATCH V4 2/6] loop: add helper lo_rw_aio_prep()
> * [PATCH V4 3/6] loop: add lo_submit_rw_aio()
> * [PATCH V4 4/6] loop: move command blkcg/memcg initialization into loop_queue_work
> * [PATCH V4 5/6] loop: try to handle loop aio command via NOWAIT IO first
> * [PATCH V4 6/6] loop: add hint for handling aio via IOCB_NOWAIT
>
> and found the following issue:
> WARNING in lo_submit_rw_aio
>
> Full report is available here:
> https://ci.syzbot.org/series/0ffdb6b4-a5fe-48da-9473-d2a926e780bd
>
> ***
>
> WARNING in lo_submit_rw_aio
>
> tree: torvalds
> URL: https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
> base: 07e27ad16399afcd693be20211b0dfae63e0615f
> arch: amd64
> compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> config: https://ci.syzbot.org/builds/3aba003b-2400-4e88-9a31-c09ab4e41a84/config
> C repro: https://ci.syzbot.org/findings/dc97454c-d87b-41f5-a44a-7182e666cfd5/c_repro
> syz repro: https://ci.syzbot.org/findings/dc97454c-d87b-41f5-a44a-7182e666cfd5/syz_repro
>
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 5958 at drivers/block/loop.c:907 loop_inc_blocking_writes drivers/block/loop.c:907 [inline]
Thanks for your report!
Looks wrong lock is asserted, and the following change can fix it:
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 911262b648ce..f3372bf35fd5 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -904,7 +904,7 @@ static inline int queue_on_root_worker(struct cgroup_subsys_state *css)
static inline void loop_inc_blocking_writes(struct loop_device *lo,
struct loop_cmd *cmd)
{
- lockdep_assert_held(&lo->lo_mutex);
+ lockdep_assert_held(&lo->lo_work_lock);
if (req_op(blk_mq_rq_from_pdu(cmd)) == REQ_OP_WRITE)
lo->lo_nr_blocking_writes += 1;
@@ -913,7 +913,7 @@ static inline void loop_inc_blocking_writes(struct loop_device *lo,
static inline void loop_dec_blocking_writes(struct loop_device *lo,
struct loop_cmd *cmd)
{
- lockdep_assert_held(&lo->lo_mutex);
+ lockdep_assert_held(&lo->lo_work_lock);
if (req_op(blk_mq_rq_from_pdu(cmd)) == REQ_OP_WRITE)
lo->lo_nr_blocking_writes -= 1;
Thanks,
Ming
prev parent reply other threads:[~2025-09-29 1:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-28 13:29 [PATCH V4 0/6] loop: improve loop aio perf by IOCB_NOWAIT Ming Lei
2025-09-28 13:29 ` [PATCH V4 1/6] loop: add helper lo_cmd_nr_bvec() Ming Lei
2025-10-03 7:04 ` Christoph Hellwig
2025-09-28 13:29 ` [PATCH V4 2/6] loop: add helper lo_rw_aio_prep() Ming Lei
2025-10-03 7:04 ` Christoph Hellwig
2025-09-28 13:29 ` [PATCH V4 3/6] loop: add lo_submit_rw_aio() Ming Lei
2025-10-03 7:04 ` Christoph Hellwig
2025-09-28 13:29 ` [PATCH V4 4/6] loop: move command blkcg/memcg initialization into loop_queue_work Ming Lei
2025-09-28 13:29 ` [PATCH V4 5/6] loop: try to handle loop aio command via NOWAIT IO first Ming Lei
2025-09-29 6:44 ` Yu Kuai
2025-09-29 9:18 ` Ming Lei
2025-09-28 13:29 ` [PATCH V4 6/6] loop: add hint for handling aio via IOCB_NOWAIT Ming Lei
2025-10-03 7:06 ` Christoph Hellwig
2025-10-06 14:18 ` Ming Lei
2025-10-07 6:33 ` Christoph Hellwig
2025-10-07 12:15 ` Ming Lei
2025-10-08 5:56 ` Christoph Hellwig
2025-10-09 1:25 ` Ming Lei
2025-10-13 6:26 ` Christoph Hellwig
2025-10-13 8:26 ` Ming Lei
2025-09-28 18:42 ` [syzbot ci] Re: loop: improve loop aio perf by IOCB_NOWAIT syzbot ci
2025-09-29 1:13 ` Ming Lei [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=aNndPs6kom-n4HSs@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=syzbot+ci7622762f075d3fa0@syzkaller.appspotmail.com \
--cc=syzbot@lists.linux.dev \
--cc=syzkaller-bugs@googlegroups.com \
--cc=zhaoyang.huang@unisoc.com \
/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;
as well as URLs for NNTP newsgroup(s).