Fwd: systool -c fc_host does not list all fc_hosts

Jiatong Shen <[email protected]> Sat, 13 Aug 2022 09:05:58 +0800
Newsgroups gmane.linux.tools.diag.devel
Message-ID <CALqm=dcM8gk300jR0OOWgAdRthj8rhAetvyBjUSfmEuzrydPnA@mail.gmail.com>
--===============0010700562302443495==
Content-Type: multipart/alternative; boundary="000000000000ff0b5f05e61500c8"

--000000000000ff0b5f05e61500c8
Content-Type: text/plain; charset="UTF-8"

---------- Forwarded message ---------
From: Jiatong Shen <[email protected]>
Date: Sat, Aug 13, 2022 at 9:01 AM
Subject: systool -c fc_host does not list all fc_hosts
To: <[email protected]>, <[email protected]>, <[email protected]>, <
[email protected]>


Hello,

  I am trouble shooting a weird situation where host1 is not displayed.
Annd the output is at last. After reading through code, I am suspecting
that https://github.com/Distrotech/sysfsutils/issues/4 the comparison might
be incorrect. The reason is that readidr may not return dir in an ascending
order which hereby causing host1 matching host18 which already exists.

So my question is is it possible to change strncmp to strcmp? Thank you
very much.

And the logs:

# systool -c fc_host
Class = "fc_host"

  Class Device = "host16"
    Device = "host16"

  Class Device = "host17"
    Device = "host17"

  Class Device = "host18"
    Device = "host18"


:~# ls /sys/class/fc_host
host1  host16  host17  host18

-- 

Best Regards,

Jiatong Shen


-- 

Best Regards,

Jiatong Shen

--000000000000ff0b5f05e61500c8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">---------- Forwarded message ---------<br>From: <strong cla=
ss=3D"gmail_sendername" dir=3D"auto">Jiatong Shen</strong> <span dir=3D"aut=
o">&lt;<a href=3D"mailto:[email protected]">[email protected]</a>&g=
t;</span><br>Date: Sat, Aug 13, 2022 at 9:01 AM<br>Subject: systool -c fc_h=
ost does not list all fc_hosts<br>To:  &lt;<a href=3D"mailto:[email protected].=
com">[email protected]</a>&gt;,  &lt;<a href=3D"mailto:[email protected]"=
>[email protected]</a>&gt;,  &lt;<a href=3D"mailto:[email protected]">moha=
[email protected]</a>&gt;,  &lt;<a href=3D"mailto:[email protected]=
orge.net">[email protected]</a>&gt;<br></div><br><br><=
div dir=3D"ltr">Hello,<div><br></div><div>=C2=A0 I am trouble shooting a we=
ird situation where host1 is not displayed. Annd the output is at last. Aft=
er reading through code, I am suspecting that=C2=A0<a href=3D"https://githu=
b.com/Distrotech/sysfsutils/issues/4" target=3D"_blank">https://github.com/=
Distrotech/sysfsutils/issues/4</a> the comparison might be incorrect. The r=
eason is that readidr may not return dir in an ascending order which hereby=
 causing host1 matching host18 which already exists.</div><div><br></div><d=
iv>So my question is is it possible to change strncmp to strcmp? Thank you =
very much.</div><div><br></div><div>And the logs:</div><div><br></div><div>=
# systool -c fc_host<br>Class =3D &quot;fc_host&quot;<br><br>=C2=A0 Class D=
evice =3D &quot;host16&quot;<br>=C2=A0 =C2=A0 Device =3D &quot;host16&quot;=
<br><br>=C2=A0 Class Device =3D &quot;host17&quot;<br>=C2=A0 =C2=A0 Device =
=3D &quot;host17&quot;<br><br>=C2=A0 Class Device =3D &quot;host18&quot;<br=
>=C2=A0 =C2=A0 Device =3D &quot;host18&quot;<br><br><br>:~# ls /sys/class/f=
c_host<br>host1 =C2=A0host16 =C2=A0host17 =C2=A0host18<br><div><br></div>--=
 <br><div dir=3D"ltr" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><=
br><div>Best Regards,</div><div><br></div><div>Jiatong Shen</div></div></di=
v></div></div>
</div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr" class=3D"gma=
il_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><br><div>=
Best Regards,</div><div><br></div><div>Jiatong Shen</div></div></div></div>

--000000000000ff0b5f05e61500c8--


--===============0010700562302443495==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============0010700562302443495==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Linux-diag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-diag-devel

--===============0010700562302443495==--