From: Bart Van Assche <bvanassche@acm.org>
To: Yingjie Wang <x-professor@outlook.com>,
"Martin K. Petersen" <mkp@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
Yang Xiuwei <yangxiuwei@kylinos.cn>,
James Houghton <jthoughton@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/4] scsi: core: release SG_IO request before user copyback
Date: Thu, 19 Nov 2026 13:36:10 -0800 [thread overview]
Message-ID: <3dcb1a44-6e99-4d34-9b49-675d98c90da1@acm.org> (raw)
In-Reply-To: <1fe63161bcec115131d7004cfd59f465f0de4f69.1794990780.git.x-professor@outlook.com>
On 11/18/26 12:33 AM, Yingjie Wang wrote:
> Four synchronous SCSI passthrough paths copy data to userspace, or unmap
> a user buffer that needs copyback, while they still hold the completed
> request. If that user access faults and the fault needs I/O from the
> same queue, the task can wait for a tag held by the request it would
> only release after the fault returns.
Does the same dependency exist on the submission side? All four code
paths access user memory after scsi_alloc_request() has succeeded and
before blk_execute_rq() is called:
- sg_io() calls copy_from_user() from scsi_fill_sghdr_rq() and next
calls blk_rq_map_user_io().
- sg_scsi_ioctl() calls copy_from_user() twice.
- scsi_bsg_sg_io_fn() calls copy_from_user() and blk_rq_map_user().
- sr_read_cdda_bpc() calls blk_rq_map_user().
If no I/O scheduler has been selected, the request allocated by
scsi_alloc_request() already owns a driver tag. If the host has only
one tag and if any of the above user memory accesses triggers a page
fault that requires I/O on the same queue, isn't that the same deadlock
as the one this series fixes? Pinning a data buffer that is not yet
resident seems at least as likely to me as a fault during copyback.
With mq-deadline there are two scheduler tags for a queue depth of one
so a single nested I/O request can make progress in that case.
I have not tried to trigger this. If my analysis is correct, please
either fix the submission side too or mention in the cover letter that
this series only addresses the completion side.
Thanks,
Bart.
next prev parent reply other threads:[~2026-11-19 21:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 8:33 [PATCH v4 0/4] scsi: release completed passthrough requests " Yingjie Wang
2026-11-18 8:33 ` [PATCH v4 1/4] scsi: core: release SG_IO request " Yingjie Wang
2026-11-19 21:36 ` Bart Van Assche [this message]
2026-11-18 8:33 ` [PATCH v4 2/4] scsi: core: release legacy ioctl " Yingjie Wang
2026-11-19 21:36 ` Bart Van Assche
2026-11-19 21:37 ` Bart Van Assche
2026-11-18 8:33 ` [PATCH v4 3/4] scsi: sr: release CDDA " Yingjie Wang
2026-11-18 8:33 ` [PATCH v4 4/4] scsi: bsg: release synchronous " Yingjie Wang
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=3dcb1a44-6e99-4d34-9b49-675d98c90da1@acm.org \
--to=bvanassche@acm.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=jthoughton@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=x-professor@outlook.com \
--cc=yangxiuwei@kylinos.cn \
/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
all inboxes | Powered by JetHome®