All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yingjie Wang <x-professor@outlook.com>
To: "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>,
	Bart Van Assche <bvanassche@acm.org>,
	Yang Xiuwei <yangxiuwei@kylinos.cn>, Jens Axboe <axboe@kernel.dk>,
	"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 0/6] scsi: release completed passthrough requests before user copyback
Date: Mon, 26 Oct 2026 08:29:33 +0000	[thread overview]
Message-ID: <cover.1793003363.git.x-professor@outlook.com> (raw)

This rerolls the request-lifetime changes from the original six-patch
series. The independent data-copyback error fixes have already been
posted separately and received Yang Xiuwei's Reviewed-by for the series:

  https://lore.kernel.org/r/cover.1792772194.git.x-professor@outlook.com

This series is based on those two patches applied to mainline
390febb5805d ("Merge tag 'for-7.4-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux").
The base and prerequisite patch IDs are recorded below.

Changes since the original series:

- Release completed synchronous requests before sense/data copyback,
  with the request-backed output fields saved first. The original BIO
  chain remains owned by the user mapping until it is unmapped.
- Include SCSI_IOCTL_SEND_COMMAND as a separate fix for the legacy
  sibling identified during review.
- Rework BSG io_uring so end-I/O saves completion state and returns
  RQ_END_IO_FREE. Task work does not use rq or scmd. Optional sense
  storage is allocated and charged to memcg before acquiring the request;
  nonblocking allocation failure returns -EAGAIN for retry.
- Keep the pre-existing sense-length reporting error in a separate
  patch, and bound the new snapshot by its allocated capacity.
- Trace the synchronous lifetime dependency back through the file
  moves to the scsi-mq request pool, rather than a 2005 merge commit.

The old 1/6, 2/6, 3/6 and 5/6 correspond to the new 1/6, 3/6, 4/6 and
6/6. The new 2/6 and 5/6 address the legacy ioctl and sense-length
reporting respectively. Transport BSG remains outside this series: its
separate queue needs its own resource-dependency analysis.

Validation used matching x86-64 KASAN/lockdep configurations with QEMU
and virtual SCSI disk/CD-ROM devices. Before this series, 20/20 traced
DEFER_TASKRUN completions retained their request before task work ran;
afterward, the request was released in that window. The tests also
cover synchronous ioctls, sense/data copy errors, fixed buffers, io-wq,
pending-ring close, and fault-injected allocation failures. CDDA testing
exercised the virtual device's error path, not successful audio extraction
from real media. Each intermediate commit was built independently; i386
and modular SCSI with IO_URING disabled were also object-built.

The earlier one-tag fault results are historical evidence, not newly
rerun deadlock tests of this revision. The dependency when completed
requests retain all tags available to nested I/O is a source-level
argument; it is not a claim of a new multi-tag exhaustion experiment.


v1: https://lore.kernel.org/r/cover.1792237341.git.x-professor@outlook.com
Review follow-up: https://lore.kernel.org/r/20261022.scsi-copyback-review.31b8d6a70f4c@outlook.com
CDDA reply: https://lore.kernel.org/r/20261022.scsi-cdda-lifetime.8f31a2c97b42@outlook.com

Yingjie Wang (6):
  scsi: core: release SG_IO request before user copyback
  scsi: core: release legacy ioctl request before user copyback
  scsi: sr: release CDDA request before user copyback
  scsi: bsg: release synchronous request before user copyback
  scsi: bsg: clear io_uring sense length on copy failure
  scsi: bsg: release io_uring requests in end-I/O

 drivers/scsi/scsi_bsg.c   | 102 ++++++++++++++++++++++++--------------
 drivers/scsi/scsi_ioctl.c |  34 +++++++++----
 drivers/scsi/sr.c         |   3 ++
 3 files changed, 92 insertions(+), 47 deletions(-)


base-commit: 390febb5805d3bb830402679f277f1d5f309e6bc
prerequisite-patch-id: 8dbaa81edcd4c0acbe43169d7d1c7012f6bec995
prerequisite-patch-id: 321b182025cad20ba75cc00122e50daba8d1a52f
-- 
2.43.0


             reply	other threads:[~2026-10-26  8:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  8:29 Yingjie Wang [this message]
2026-10-26  8:29 ` [PATCH v2 1/6] scsi: core: release SG_IO request before user copyback Yingjie Wang
2026-10-26  8:29 ` [PATCH v2 2/6] scsi: core: release legacy ioctl " Yingjie Wang
2026-10-26  8:29 ` [PATCH v2 3/6] scsi: sr: release CDDA " Yingjie Wang
2026-10-26  8:29 ` [PATCH v2 4/6] scsi: bsg: release synchronous " Yingjie Wang
2026-10-26  8:29 ` [PATCH v2 5/6] scsi: bsg: clear io_uring sense length on copy failure Yingjie Wang
2026-10-26  9:40   ` Yang Xiuwei
2026-10-26  8:29 ` [PATCH v2 6/6] scsi: bsg: release io_uring requests in end-I/O Yingjie Wang
2026-10-26  9:40   ` Yang Xiuwei
2026-10-27  9:35     ` Yang Xiuwei
2026-10-29 16:39       ` Yingjie Wang
2026-10-26 15:56   ` Bart Van Assche

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=cover.1793003363.git.x-professor@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.