nvme: make passthrough user copyback failure-safe
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nvme: release passthrough resources before user copybackdrivers/ | +2 | 1 reply | |
| 2/4 | nvme: report synchronous passthrough copyback failuresdrivers/ | +4 | 1 reply | |
| 3/4 | nvme: report io_uring task-work copyback failuresdrivers/ | +4 | 1 reply | |
| 4/4 | nvme: harden local IOPOLL user copybackdrivers/ | +9 | 1 reply |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig |
|---|---|
| 1/4 | R-b |
| 2/4 | R-b |
| 3/4 | R-b |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] nvme: make passthrough user copyback failure-safe
NVMe passthrough completion currently calls blk_rq_unmap_user() while the completed request can still own a queue tag. A copyback page fault that needs I/O from the same low-depth namespace can therefore wait for the tag held by the request performing the copyback. The synchronous, task-work, and local IOPOLL paths also discard copyback failures.
Release the request before synchronous and local-IOPOLL user copyback, and propagate copyback failures through the ioctl or io_uring CQE when there is no earlier command error. Keep nvme_passthru_end() based on the real controller result rather than a later userspace-copy error.
With an NVMe I/O queue depth of two, a same-namespace file-backed destination hung beyond 60 seconds before patch 1 and completed in 20/20 runs afterward. Unaligned PROT_NONE destinations returned false success before the error-reporting changes and -EFAULT afterward. The local IOPOLL test returned -EFAULT for all 1,280 commands, while writable controls continued to succeed.
The series passed scripts/checkpatch.pl --strict, focused W=1 builds, the full bzImage build used for the wider audit, and QEMU differential tests on the affected completion paths.
Yingjie Wang (4):
nvme: release passthrough resources before user copyback
nvme: report synchronous passthrough copyback failures
nvme: report io_uring task-work copyback failures
nvme: harden local IOPOLL user copyback
drivers/nvme/host/ioctl.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
base-commit: 0fcb05b72344f40806cbe810de8872f1698bf053
Signature · 1 line
2.43.0