mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yingjie Wang <x-professor@outlook.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: "Martin K . Petersen" <mkp@kernel.org>,
	"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Jens Axboe <axboe@kernel.dk>, Yang Xiuwei <yangxiuwei@kylinos.cn>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Yingjie Wang <x-professor@outlook.com>
Subject: [PATCH v2 0/2] scsi: bsg: report data copyback failures
Date: Fri, 23 Oct 2026 16:23:01 +0000	[thread overview]
Message-ID: <cover.1792772194.git.x-professor@outlook.com> (raw)

The synchronous and io_uring SCSI BSG completion paths discard the return
value from blk_rq_unmap_user(). For data-in commands that use a bounce
buffer, unmapping copies the completed data back to userspace. A failure
during that copyback is then lost, so SG_IO can return success and
io_uring can post a CQE with res == 0 despite the copyback failure.

Propagate the unmap result while preserving existing sense-copy error
precedence. The two fixes are independent and can be applied separately.

This is v2 of the two error-propagation patches from the six-patch series
posted at:

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

Changes in v2:

- Split these two error-propagation fixes from the request-release changes
  following Bart Van Assche's review.
- Rebase onto 734bef548a96 (Merge tag 'net-next-7.4').
- Recheck the synchronous Fixes tag. The SG_IO v4 completion helper
  already discarded blk_rq_unmap_user() errors when 10e8855b9451
  introduced the ioctl path.
- Rerun the focused build and the synchronous and io_uring QEMU tests on
  the new base and final trees.

Validation on x86_64 used QEMU 8.2.2 and a virtio-scsi disk. On the base
tree, ioctl() returned 0 and the io_uring CQE had res == 0 in 20/20 runs
despite the copyback failure. With this series applied, ioctl() returned
-1 with errno EFAULT in 20/20 runs, and the io_uring CQE had
res == -EFAULT in 20/20 runs. Writable controls succeeded in 20/20 runs
in both trees, and the guest logs contained no BUG, WARNING, KASAN,
UBSAN, or panic diagnostics.

The base and final trees also completed:

  make O=<build-dir> -j24 W=1 CONFIG_WERROR= bzImage

The command used CONFIG_WERROR= because the saved configuration enables
WERROR and the full W=1 build reports pre-existing warnings in unrelated
files. No warning was emitted for drivers/scsi/scsi_bsg.c.

An AI coding assistant was used to inspect the reviewed series, verify the
history and call paths, and prepare this reroll. The code and test results
are provided for human review.

Yingjie Wang (2):
  scsi: bsg: report synchronous data copyback failures
  scsi: bsg: report io_uring data copyback failures

 drivers/scsi/scsi_bsg.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
-- 
2.43.0


             reply	other threads:[~2026-10-23 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 16:23 Yingjie Wang [this message]
2026-10-23 16:23 ` [PATCH v2 1/2] scsi: bsg: report synchronous " Yingjie Wang
2026-10-23 16:23 ` [PATCH v2 2/2] scsi: bsg: report io_uring " Yingjie Wang
2026-10-26  1:06 ` [PATCH v2 0/2] scsi: bsg: report " Yang Xiuwei
2026-10-26 17:47 ` 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.1792772194.git.x-professor@outlook.com \
    --to=x-professor@outlook.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.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®