* [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection
@ 2021-09-01 8:53 Baokun Li
2021-09-02 23:58 ` Lee Duncan
2021-09-14 3:43 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Baokun Li @ 2021-09-01 8:53 UTC (permalink / raw)
To: lduncan, cleech, jejb, martin.petersen, open-iscsi, linux-scsi,
linux-kernel
Cc: patchwork, libaokun1, yukuai3
ISCSI_NET_PARAM_IFACE_ENABLE belongs to enum iscsi_net_param instead of
iscsi_iface_param,so move it to ISCSI_NET_PARAM. Otherwise, when we call
into the driver we might not match and return that we don't want attr
visible in sysfs. Found in code review.
Fixes: e746f3451ec7 ("scsi: iscsi: Fix iface sysfs attr detection")
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
drivers/scsi/scsi_transport_iscsi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index d8b05d8b5470..58027207f08d 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -441,9 +441,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
struct iscsi_transport *t = iface->transport;
int param = -1;
- if (attr == &dev_attr_iface_enabled.attr)
- param = ISCSI_NET_PARAM_IFACE_ENABLE;
- else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
+ if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO;
else if (attr == &dev_attr_iface_header_digest.attr)
param = ISCSI_IFACE_PARAM_HDRDGST_EN;
@@ -483,7 +481,9 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
if (param != -1)
return t->attr_is_visible(ISCSI_IFACE_PARAM, param);
- if (attr == &dev_attr_iface_vlan_id.attr)
+ if (attr == &dev_attr_iface_enabled.attr)
+ param = ISCSI_NET_PARAM_IFACE_ENABLE;
+ else if (attr == &dev_attr_iface_vlan_id.attr)
param = ISCSI_NET_PARAM_VLAN_ID;
else if (attr == &dev_attr_iface_vlan_priority.attr)
param = ISCSI_NET_PARAM_VLAN_PRIORITY;
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection
2021-09-01 8:53 [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection Baokun Li
@ 2021-09-02 23:58 ` Lee Duncan
2021-09-14 3:43 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Lee Duncan @ 2021-09-02 23:58 UTC (permalink / raw)
To: Baokun Li, cleech, jejb, martin.petersen, open-iscsi, linux-scsi,
linux-kernel
Cc: patchwork, yukuai3
On 9/1/21 1:53 AM, Baokun Li wrote:
> ISCSI_NET_PARAM_IFACE_ENABLE belongs to enum iscsi_net_param instead of
> iscsi_iface_param,so move it to ISCSI_NET_PARAM. Otherwise, when we call
> into the driver we might not match and return that we don't want attr
> visible in sysfs. Found in code review.
>
> Fixes: e746f3451ec7 ("scsi: iscsi: Fix iface sysfs attr detection")
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> drivers/scsi/scsi_transport_iscsi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
> index d8b05d8b5470..58027207f08d 100644
> --- a/drivers/scsi/scsi_transport_iscsi.c
> +++ b/drivers/scsi/scsi_transport_iscsi.c
> @@ -441,9 +441,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
> struct iscsi_transport *t = iface->transport;
> int param = -1;
>
> - if (attr == &dev_attr_iface_enabled.attr)
> - param = ISCSI_NET_PARAM_IFACE_ENABLE;
> - else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
> + if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
> param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO;
> else if (attr == &dev_attr_iface_header_digest.attr)
> param = ISCSI_IFACE_PARAM_HDRDGST_EN;
> @@ -483,7 +481,9 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
> if (param != -1)
> return t->attr_is_visible(ISCSI_IFACE_PARAM, param);
>
> - if (attr == &dev_attr_iface_vlan_id.attr)
> + if (attr == &dev_attr_iface_enabled.attr)
> + param = ISCSI_NET_PARAM_IFACE_ENABLE;
> + else if (attr == &dev_attr_iface_vlan_id.attr)
> param = ISCSI_NET_PARAM_VLAN_ID;
> else if (attr == &dev_attr_iface_vlan_priority.attr)
> param = ISCSI_NET_PARAM_VLAN_PRIORITY;
>
Reviewed-by: Lee Duncan <lduncan@suse.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection
2021-09-01 8:53 [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection Baokun Li
2021-09-02 23:58 ` Lee Duncan
@ 2021-09-14 3:43 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-09-14 3:43 UTC (permalink / raw)
To: Baokun Li, jejb, linux-kernel, cleech, open-iscsi, linux-scsi, lduncan
Cc: Martin K . Petersen, patchwork, yukuai3
On Wed, 1 Sep 2021 16:53:36 +0800, Baokun Li wrote:
> ISCSI_NET_PARAM_IFACE_ENABLE belongs to enum iscsi_net_param instead of
> iscsi_iface_param,so move it to ISCSI_NET_PARAM. Otherwise, when we call
> into the driver we might not match and return that we don't want attr
> visible in sysfs. Found in code review.
>
>
Applied to 5.15/scsi-fixes, thanks!
[1/1] scsi: iscsi: Adjuest iface sysfs attr detection
https://git.kernel.org/mkp/scsi/c/4e2855082925
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-14 3:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 8:53 [PATCH -next] scsi: iscsi: Adjuest iface sysfs attr detection Baokun Li
2021-09-02 23:58 ` Lee Duncan
2021-09-14 3:43 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).