Re: [PATCH V2] target: fix the pgr/alua_support_store functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06.09.21 17:18, Maurizio Lombardi wrote:
Commit 356ba2a8bc8d ("scsi: target: tcmu: Make pgr_support and
alua_support attributes writable")
introduced support for changeable alua_support and pgr_support
target attributes. They can only be changed
if the backstore is user-backed, otherwise the kernel returns -EINVAL.

This triggers a warning in the targetcli/rtslib code when performing
a target restore that includes non-userbacked backstores:

#targetctl restore
Storage Object block/storage1: Cannot set attribute alua_support:
[Errno 22] Invalid argument, skipped
Storage Object block/storage1: Cannot set attribute pgr_support:
[Errno 22] Invalid argument, skipped

Fix this warning by returning an error code only if we are really
going to flip the PGR/ALUA bit in the transport_flags field,
otherwise we'll do nothing and return success.

Return ENOSYS instead of EINVAL if the pgr/alua attributes
can't be changed, this way it'll be possible for userspace to understand
if the operation failed because an invalid value has been passed
to strtobool() or because the attributes are fixed.

Fixes: 356ba2a8bc8d ("scsi: target: tcmu: Make pgr_support and alua_support attributes writable")

v2: replace EOPNOTSUPP with ENOSYS

Signed-off-by: Maurizio Lombardi <mlombard@xxxxxxxxxx>
---

Reviewed-by: Bodo Stroesser <bostroesser@xxxxxxxxx>



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux