open-iscsi / rtslib-fb

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

targetccli saveconfig no longer works because pi_prot_format is write-only #145

Closed gonzoleeman closed 3 years ago

gonzoleeman commented 5 years ago

A recent kernel change makes pi_prot_format, a backstore attribute in sysfs, write-only (see commit .6baca7601bdee2e5). This makes saveconfig fail with an access error, since it tries to read everything in the attrib directory so that it can save a backstore's current state.

I have submitted pull request #144 to fix this issue. The basic approach is to assume the value of the attribute is zero if we cannot read it. I'm not sure this is a general fix, except that this is the only case so far of a write-only attribute. Perhaps somebody more familiar with the code has a better idea? But at least this makes saveconfig work on my laptop, running a patched 4.12 kernel.

gonzoleeman commented 5 years ago

Now Issue #146

maurizio-lombardi commented 5 years ago

Thanks for the report, this is going to be fixed in kernel 5.0

https://marc.info/?l=target-devel&m=154930519830248&w=2

gonzoleeman commented 5 years ago

Yes, but there are still currently-available distros (like openSUSE Leap 15.0) that have the write-only attribute.

gonzoleeman commented 3 years ago

Closing this issue then.