From: Yingjie Wang <x-professor@outlook.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"mkp@kernel.org" <mkp@kernel.org>,
"yangxiuwei@kylinos.cn" <yangxiuwei@kylinos.cn>,
"axboe@kernel.dk" <axboe@kernel.dk>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/6] scsi: make SG_IO user copyback failure-safe
Date: Thu, 22 Oct 2026 07:52:14 +0000 [thread overview]
Message-ID: <20261022.scsi-copyback-review.31b8d6a70f4c@outlook.com> (raw)
In-Reply-To: <7a2dfdd0-812c-470a-9b31-402dc601f05c@acm.org>
Hi Bart,
Thanks for the detailed review. I checked the relevant paths against
the series base, 0fcb05b72344.
You're right about the request/tag-retention window in patch 5/6. It
still returns RQ_END_IO_NONE, so moving blk_mq_free_request() to the
beginning of task work does not address the window before task work
runs.
For the reroll, I plan to preallocate the required sense storage at
submission and save the request-backed completion state in
scsi_bsg_uring_cmd_done(). This would let end-I/O return
RQ_END_IO_FREE, while task work handles the unmap, user copies and CQE
completion without accessing rq or scmd. I'll check the allocation and
cleanup paths, including nonblocking submission, and retest with
IORING_SETUP_DEFER_TASKRUN.
The tag/fault dependency itself is not limited to a one-tag queue; it
can also arise if completed requests retain all tags available to the
nested fault I/O. So far, however, I have only reproduced the one-tag
case at runtime. I'll make that distinction explicit in the cover
letter.
For the sense data, I'll bound the snapshot by its storage size even
though valid-sense processing in the midlayer caps the computed length.
The existing sense_len_wr behavior on copy failure predates this
series, so that should be a separate fix.
I also found the same copy-before-free ordering in sg_scsi_ioctl() and
will validate that path as part of the lifetime reroll.
bsg_transport_sg_io_fn() uses a separate transport BSG queue, so I do
not want to claim the same demonstrated deadlock there without a
separate audit.
Patches 4/6 and 6/6 are independent copyback-error fixes. I'll split
them out so they are not held up by the larger lifetime rework. I also
need to recheck the lifecycle-related Fixes tags across the earlier
implementations and file moves.
Thanks,
Yingjie
prev parent reply other threads:[~2026-10-22 7:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 15:41 Wang Yingjie
2026-10-18 15:41 ` [PATCH 1/6] scsi: core: release SG_IO request before copying to userspace Wang Yingjie
2026-10-18 15:41 ` [PATCH 2/6] scsi: sr: release CDDA " Wang Yingjie
2026-10-19 20:33 ` Bart Van Assche
2026-10-22 7:51 ` Yingjie Wang
2026-10-18 15:41 ` [PATCH 3/6] scsi: bsg: release synchronous request before user copyback Wang Yingjie
2026-10-18 15:41 ` [PATCH 4/6] scsi: bsg: report synchronous data copyback failures Wang Yingjie
2026-10-18 15:41 ` [PATCH 5/6] scsi: bsg: release io_uring request before user copyback Wang Yingjie
2026-10-18 15:41 ` [PATCH 6/6] scsi: bsg: report io_uring data copyback failures Wang Yingjie
2026-10-18 16:41 ` [PATCH 0/6] scsi: make SG_IO user copyback failure-safe Bart Van Assche
2026-10-19 6:32 ` Wang Yingjie
2026-10-19 21:11 ` Bart Van Assche
2026-10-22 7:52 ` Yingjie Wang [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=20261022.scsi-copyback-review.31b8d6a70f4c@outlook.com \
--to=x-professor@outlook.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--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®