[PATCH] nvmet: use scnprintf() in the passthru device_path show

Keith Busch kbusch at kernel.org
Wed Dec 2 07:15:36 PST 2026


On Tue, 1 Dec 2026 19:04:48 +0800, Lin Tzu Yang wrote:
> nvmet_passthru_device_path_show() returns the value of snprintf(),
> which is the length the output would have had. device_path keeps up
> to 4095 bytes, and for such a path the string plus newline does not
> fit: snprintf() stores 4095 characters and the NUL, and returns 4096.
> configfs then hands all 4096 bytes to userspace, so the read ends
> with a NUL byte instead of the last character of the path.
> 
> [...]

Thanks, applied to nvme-7.4.

[1/1] nvmet: use scnprintf() in the passthru device_path show
      commit: 24ceb59772a29ae70b5f0f23c4835f00310d1b41
--
Keith Busch <kbusch at kernel.org>




More information about the Linux-nvme mailing list