Re: [PATCH V2 2/2] ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 18, 2025 / 22:12, Jared Holzman wrote:
> On 14/05/2025 4:50, Shinichiro Kawasaki wrote:
> > On Apr 25, 2025 / 09:37, Ming Lei wrote:
> >> ublk_cancel_cmd() calls io_uring_cmd_done() to complete uring_cmd, but
> >> we may have scheduled task work via io_uring_cmd_complete_in_task() for
> >> dispatching request, then kernel crash can be triggered.
> >>
> >> Fix it by not trying to canceling the command if ublk block request is
> >> started.
> > 
> > I found that the blktests test case ublk/002 often hangs with the recent
> > v6.15-rcX kernel tags with the INFO at iou-wrk-X [1]. The hang is recreated
> > in stable manner when I repeat the test case a few times.
> > 
> > I bisected and this patch as the commit f40139fde527 triggers the hang.
> > When I reverted the commit from the kernel v6.15-rc6, the hang disappeared.
> > (I repeated ublk/002 20 times, and observed no hang.)
> > 
> > The hang was observed with test systems with Fedora 42. I do not observe
> > the hang with Fedora 41, but not sure why. liburing version difference
> > could be the reason (v2.6 for Fedora 41, v2.9 for Fedora 42).
> > 
> > Actions for fix will be appreciated.
> > 
> > [1]
> > 
> > [ 4497.777695] [ T130863] run blktests ublk/002 at 2025-05-07 14:48:32
> > [ 4499.983130] [  T67084] blk_print_req_error: 58 callbacks suppressed
> > [ 4499.983136] [  T67084] I/O error, dev ublkb0, sector 106830432 op 0x0:(READ) flags 0x800 phys_

[...]

> > ...
> 
> Hi Shinichiro,
> 
> Are you referring to test_generic_02.sh in tools/testing/selftests/ublk?

No. As I noted above, I refer to blktests [2] and its test case ublk/002 [3].

[2] https://github.com/osandov/blktests
[3] https://github.com/osandov/blktests/blob/master/tests/ublk/002




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux