open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
73 stars 90 forks source link

Fix handling of sysfs RW attrs that are actually RO #169

Closed gonzoleeman closed 4 years ago

gonzoleeman commented 4 years ago

Kernel commit 356ba2a8bc8d ("scsi: target: tcmu: Make gr_support and alua_support attributes writable"), made the alua_support and pgr_support sysfs attributes writable so that individual target drivers could change them. This means that the filesystem attributes might saw read-write, but the attributes can in fact be read-only. When a user tries to write to them, in this case, they EINVAL.

This causes rtslib to throw error messages when one does a "targetctl restore" like these:

Storage Object fileio/file01: Cannot set attribute alua_support: [Errno 22] Invalid argument, skipped Storage Object fileio/file01: Cannot set attribute pgr_support: [Errno 22] Invalid argument, skipped

While these messages are benign, they will cause confusion, since (1) there's nothing wrong, and (2) they didn't occur before above- mentioned kernel commit.

This fix tells rtslib to ignore errno 22 for these two attributes.

edacval commented 3 years ago

Issue still in place

maurizio-lombardi commented 3 years ago

Issue still in place

I fixed it in the kernel target driver a few weeks ago:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef7ae7f746e95c6fa4ec2bcfacb949c36263da78

edacval commented 3 years ago

I fixed it in the kernel target driver a few weeks ago:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef7ae7f746e95c6fa4ec2bcfacb949c36263da78

Thanks !