Re: [PATCH 2/5] nvme: map passthrough data when the length is nonzero

From: shao.mingyin

Date: Sun Nov 22 2026 - 09:31:59 EST


Hi Caleb,

Thanks for pointing out the no-data command case. I tested it on
next-20261120 with a file-backed namespace over nvme-loop. I issued a
Read with a valid 4096-byte buffer, then reused the same ioctl command
structure for Flush. I reset the command fields for Flush and cleared
addr, leaving data_len at 4096.

Baseline Proposed change
Read, valid addr, data_len=4096 success success
Flush, addr=0, data_len=4096 success EFAULT
Flush, addr=0, data_len=0 success success

The earlier Read and Write tests only exercised commands that expect a
payload. With Flush, the old mapping check leaves the request without a
payload, and the command completes normally. The proposed check tries
to map the stale length and fails before submitting Flush. I haven't
identified a deployed application that relies on this pattern.

The case covered by 99fde895ff56 involves an offset into a registered
kernel bvec buffer, and zero is its starting offset.

I'll drop this version from the series. If the missing buffer case needs
a fix, I'll evaluate NVME_IOCTL_SUBMIT_IO separately, where the allowed
operations all require data.

Thanks,
Shao