summaryrefslogtreecommitdiff
path: root/libopeniscsiusr
diff options
context:
space:
mode:
authorChris Leech <cleech@redhat.com>2021-12-07 10:35:36 -0800
committerChris Leech <cleech@redhat.com>2021-12-07 12:08:53 -0800
commitdbc3a1f060c26d38177028b8d682b4ae1dbfb94d (patch)
tree90f75b143ddf43c05c41a0ea4bf4e89b2312cbe0 /libopeniscsiusr
parent26446c13be2b04ea3ac83f174db75476491e5c45 (diff)
downloadopen-iscsi-dbc3a1f060c26d38177028b8d682b4ae1dbfb94d.tar.gz
libopeniscsiusr: extend sysfs ignore_error to include EINVAL
The kernel change "e746f3451ec7 scsi: iscsi: Fix iface sysfs attr detection" fixed an apparently very-long-standing issue blocking iface attribute visibility in sysfs. With that fixed, and networking configuration for the iface now being readable from sysfs, iscsiadm is showing errors when be2iscsi (and probably qla4xxx from looking at the code) expose VLAN attributes but don't have a VLAN configured. Both drivers then return EINVAL on a read to vlan_id or vlan_priority. iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_id': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282 iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_priority': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282 This change makes the libopeniscsiusr code ignore a read return of EINVAL when ignore_error is set, treating it the same as a non-existent sysfs file for optional attributes. Signed-off-by: Chris Leech <cleech@redhat.com>
Diffstat (limited to 'libopeniscsiusr')
-rw-r--r--libopeniscsiusr/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopeniscsiusr/sysfs.c b/libopeniscsiusr/sysfs.c
index 355ad55..93cc1fe 100644
--- a/libopeniscsiusr/sysfs.c
+++ b/libopeniscsiusr/sysfs.c
@@ -240,7 +240,7 @@ static int iscsi_sysfs_prop_get_ll(struct iscsi_context *ctx,
errno_save = sysfs_read_file(file_path, buff, _INT32_STR_MAX_LEN);
if (errno_save != 0) {
- if (errno_save == ENOENT) {
+ if (errno_save == ENOENT || errno_save == EINVAL) {
if (! ignore_error) {
rc = LIBISCSI_ERR_SYSFS_LOOKUP;
_error(ctx, "Failed to read '%s': "