OSDN Git Service

scsi: iscsi: Fix iface sysfs attr detection
authorMike Christie <michael.christie@oracle.com>
Thu, 1 Jul 2021 00:25:59 +0000 (19:25 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 19 Jul 2021 01:07:48 +0000 (21:07 -0400)
commite746f3451ec7f91dcc9fd67a631239c715850a34
treea3ecf71e164fb43c86ee9fb7b7b1a41a1c2b7049
parent053c16ac89050ef0e8ab9dc1edaf157bf104c8c6
scsi: iscsi: Fix iface sysfs attr detection

A ISCSI_IFACE_PARAM can have the same value as a ISCSI_NET_PARAM so when
iscsi_iface_attr_is_visible tries to figure out the type by just checking
the value, we can collide and return the wrong type. When we call into the
driver we might not match and return that we don't want attr visible in
sysfs. The patch fixes this by setting the type when we figure out what the
param is.

Link: https://lore.kernel.org/r/20210701002559.89533-1-michael.christie@oracle.com
Fixes: 3e0f65b34cc9 ("[SCSI] iscsi_transport: Additional parameters for network settings")
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_iscsi.c