Re: [PATCH] scsi: scsi_devinfo: return an error when the proc write fails
From: Martin K. Petersen (Oracle)
Date: Tue Nov 17 2026 - 23:50:32 EST
On Sat, 31 Oct 2026 22:21:33 +0800, shao.mingyin@xxxxxxxxxx wrote:
> proc_scsi_devinfo_write() calls scsi_dev_info_list_add_str() but ignores
> its return value, so a write to /proc/scsi/device_info always reports
> success, even when the string is malformed and no entry was added. Users
> and scripts then believe that the quirk is in effect.
>
> scsi_init_devinfo() already checks the return value of the same function
> and fails the initialization. Return the parser error, but keep returning
> the number of bytes written on success: a proc write handler that returns
> zero for a non-empty write would look like a short write to the caller.
>
> [...]
Applied to 7.5/scsi-queue, thanks!
[1/1] scsi: scsi_devinfo: return an error when the proc write fails
https://git.kernel.org/mkp/scsi/c/787fd1429b36
--
Martin K. Petersen