scsi: core: Improve the code for showing commands in debugfs
authorBart Van Assche <bvanassche@acm.org>
Mon, 25 Mar 2024 22:47:54 +0000 (15:47 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Apr 2024 02:12:33 +0000 (22:12 -0400)
commitba0f09b0dbd81f04d8621377c72a93ab1bd34ada
tree7982afd0ef8d5c86bb40e2c2c4ac9c3d50335785
parent9972c02a806772f61ff0da7c3740be4ef0600553
scsi: core: Improve the code for showing commands in debugfs

Some but not all command information is cleared by scsi_end_request().
As an example, if scsi_show_rq() is called after a SCSI command has been
allocated and before SCMD_INITIALIZED is set, .cmnd holds the CDB
of a previous command. Showing that information in debugfs is confusing.
Hence this patch that restricts the information shown in debugfs to
valid information.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240325224755.1477910-3-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debugfs.c