Bug 174718 - iscsi-ls -l on rhel4 u2 lists blank "Type" field for netapp targets with LUN 0 not mapped
iscsi-ls -l on rhel4 u2 lists blank "Type" field for netapp targets with LUN ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: iscsi-initiator-utils (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Mike Christie
:
Depends On:
Blocks: 181409
  Show dependency treegraph
 
Reported: 2005-12-01 12:30 EST by Dave Wysochanski
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2006-0495
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-10 17:54:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to fix blank "type" field (860 bytes, text/plain)
2005-12-01 12:30 EST, Dave Wysochanski
no flags Details

  None (edit)
Description Dave Wysochanski 2005-12-01 12:30:49 EST
Description of problem:
If you fail to map LUN 0 for a netapp target, you'll get a blank "Type" field
with the "iscsi-ls -l" command.  iscsi-ls should probably just check to 
see if the type value is within range and then print "Unknown" if it's not.
I have a simple patch that does this and I'll put it in here.

Version-Release number of selected component (if applicable):


How reproducible:
Every time

Steps to Reproduce:
1. Configure iSCSI for netapp target with a single LUN mapped at #1
2. Run "iscsi-ls -l" and observe blank "Type" field
3.
  
Actual results:
# iscsi-ls -l
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005)
*******************************************************************************
TARGET NAME             : iqn.1992-08.com.netapp:sn.50391573.winston
TARGET ALIAS            :
HOST ID                 : 5
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 10.60.155.91:3260,1001
SESSION STATUS          : ESTABLISHED AT Thu Dec  1 10:08:54 EST 2005
SESSION ID              : ISID 00023d000001 TSIH 9

DEVICE DETAILS:
---------------
LUN ID : 0
  Vendor: NETAPP   Model: LUN              Rev: 0.2
  Type:                                    ANSI SCSI revision: 04

LUN ID : 1
  Vendor: NETAPP   Model: LUN              Rev: 0.2
  Type:   Direct-Access                    ANSI SCSI revision: 04
  page83 type3: 60a9800056716c38636f31684b434864
  page80: 56716c38636f31684b4348640a
  Device: /dev/sdc


Expected results:
# /sbin/iscsi-ls -l
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005)
*******************************************************************************
TARGET NAME             : iqn.1992-08.com.netapp:sn.50391573.winston
TARGET ALIAS            :
HOST ID                 : 5
BUS ID                  : 0
TARGET ID               : 0
TARGET ADDRESS          : 10.60.155.91:3260,1001
SESSION STATUS          : ESTABLISHED AT Thu Dec  1 10:08:52 EST 2005
SESSION ID              : ISID 00023d000001 TSIH 9

DEVICE DETAILS:
---------------
LUN ID : 0
  Vendor: NETAPP   Model: LUN              Rev: 0.2
  Type:   Unknown                          ANSI SCSI revision: 04

LUN ID : 1
  Vendor: NETAPP   Model: LUN              Rev: 0.2
  Type:   Unknown                          ANSI SCSI revision: 04
  page83 type3: 60a9800056716c38636f31684b434864
  page80: 56716c38636f31684b4348640a
  Device: /dev/sdc


Additional info:
Comment 1 Dave Wysochanski 2005-12-01 12:30:50 EST
Created attachment 121696 [details]
patch to fix blank "type" field
Comment 2 Dave Wysochanski 2005-12-01 14:12:08 EST
Patch is crap.

Sorry I'll fix and submit another one.
Comment 3 Dave Wysochanski 2005-12-01 14:17:08 EST
Ok, that was pretty sad.

Here's a patch that actually works:

# !diff
diff -Nurp /sbin/iscsi-ls.orig /sbin/iscsi-ls
--- /sbin/iscsi-ls.orig 2005-11-30 23:20:32.000000000 -0500
+++ /sbin/iscsi-ls      2005-12-01 14:16:52.000000000 -0500
@@ -118,7 +118,12 @@ print_lun_info()
                printf " Model: %-16s" `cat $lun/model`
                printf " Rev: %-4s\n" `cat $lun/rev`
                typeset -i type=`cat $lun/type`
-               printf "  Type:   %-17s" ${scsi_device_types[$type]}
+               type_count=${#scsi_device_types[*]}
+               if [ $type -gt $type_count ]; then
+                       printf "  Type:   %-17s"  ${scsi_device_types[10]}
+               else
+                       printf "  Type:   %-17s" ${scsi_device_types[$type]}
+               fi
                typeset -i srev=`cat $lun/scsi_level`
                if [ $(( $srev - 1 )) -eq 0 ]; then
                srev=1
Comment 4 Mike Christie 2005-12-01 14:25:02 EST
Could you send this to linux-iscsi-devel. I will pick it up from there and merge
it. I have your iscsi-ls sort patch in there and am planning on picking all
those bugs fixes upstream for U4 in a update/rebase.
Comment 5 Dave Wysochanski 2005-12-01 15:05:25 EST
Will do.

Comment 10 Red Hat Bugzilla 2006-08-10 17:54:04 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0495.html

Note You need to log in before you can comment on or make changes to this bug.