]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: iscsi: Fix iface sysfs attr detection
authorMike Christie <michael.christie@oracle.com>
Thu, 1 Jul 2021 00:25:59 +0000 (19:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 07:12:35 +0000 (09:12 +0200)
commite3a2536319326b5df4c6f1d23e6f363a35abed8f
tree48c3342e5591cf8161de20914038e2b46e6b7490
parent853262355518cd1247515b74e83fabf038aa6c29
scsi: iscsi: Fix iface sysfs attr detection

[ Upstream commit e746f3451ec7f91dcc9fd67a631239c715850a34 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_transport_iscsi.c