Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1346898

Summary: libstoragemgmt: LIB_BUG(1): BUG: Unknown error 22(Invalid argument) from _read_file().
Product: Red Hat Enterprise Linux 7 Reporter: Bruno Goncalves <bgoncalv>
Component: libstoragemgmtAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Bruno Goncalves <bgoncalv>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libstoragemgmt-1.3.2-5.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 06:10:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1347292    
Bug Blocks:    

Description Bruno Goncalves 2016-06-15 15:20:14 UTC
Description of problem:
Listing all LUN from an storage array returns:
LIB_BUG(1): BUG: Unknown error 22(Invalid argument) from _read_file(). 

Version-Release number of selected component (if applicable):
libstoragemgmt-1.3.2-1.el7.x86_64

How reproducible:
sometimes

Steps to Reproduce:
1.Try to list the volumes
lsmcli  -u "<protocol>://<user>@<storage_array>" list --type VOLUMES


Actual results:
LIB_BUG(1): BUG: Unknown error 22(Invalid argument) from _read_file(). 

Expected results:
Should list all volumes on array

Comment 2 Gris Ge 2016-06-16 10:20:14 UTC
Initial debug founds:

* root problem: 
   cat /sys/block/sdb/device/vpd_pg83 failed with invalid argument but 
   `sg_vpd --page=0x83 /dev/sdb` still works well.
   Here sdb is a iSCSI disk from NetApp ONTAP.

Problem could be 100% reproduced by Burno's beaker test case /kernel/storage/lsm/lsm_ontap, but I failed to extract the human readable reproduce steps out yet.

After downgrade to RHEL 7.2 kernel -327.el7, problem gone.

Will create bug to kernel once extracted the simple version of reproducer.

Will also fix libstoragemgmt to use udev if sysfs failed for vpd83 query.

Comment 3 Bruno Goncalves 2016-06-16 12:35:01 UTC
The root cause found by Gris on comment#2 can be reproduced without libstoragemgmt.

1. Connect to Ontap array and create a LUN. Do not map it to any initiator

2. On host, discover Ontap portal. Make sure on Ontap there is no LUN mapped to host IQN.


3. Login to iSCSI portal. It will succeed, but no SCSI device will be created as no LUN is mapped.

# lsscsi
[0:2:0:0]    disk    DELL     PERC H730 Mini   4.25  /dev/sda

4. Connect to Ontap again and map created LUN to host IQN

5. On server rescan all sessions
# iscsiadm -m session -R

# lsscsi
[0:2:0:0]    disk    DELL     PERC H730 Mini   4.25  /dev/sda 
[11:0:0:0]   disk    NETAPP   LUN              820a  /dev/sdb 
[12:0:0:0]   disk    NETAPP   LUN              820a  /dev/sdc

6.# cat /sys/block/sdb/device/vpd_pg83 
cat: /sys/block/sdb/device/vpd_pg83: Invalid argument
# ls -all /sys/block/sdb/device/vpd_pg83
-r--r--r--. 1 root root 0 Jun 16 08:27 /sys/block/sdb/device/vpd_pg83

# sg_vpd --page=0x83 /dev/sdb
Device Identification VPD page:
  Addressed logical unit:
    designator type: T10 vendor identification,  code set: ASCII
      vendor id: NETAPP  
      vendor specific:  LUN 2FiJA+Eg3CCl
    designator type: NAA,  code set: Binary
      0x60a980003246694a412b45673343436c
    designator type: EUI-64 based,  code set: Binary
      0x2b45673343436c000a98003246694a41
  Target port:
    designator type: NAA,  code set: Binary
      0x60a98000000000020a1029de00000cbc

Comment 4 Bruno Goncalves 2016-06-16 12:59:42 UTC
kernel issue is being tracked on BZ#1347292

Comment 8 Bruno Goncalves 2016-06-24 09:00:21 UTC
Verified it works well on libstoragemgmt-1.3.2-5.el7.

Comment 10 errata-xmlrpc 2016-11-04 06:10:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2016-2415.html