All of lore.kernel.org
 help / color / mirror / Atom feed
From: michael.christie@oracle.com
To: Maurizio Lombardi <mlombard@redhat.com>, martin.petersen@oracle.com
Cc: bostroesser@gmail.com, target-devel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] target: fix the pgr/alua_support_store functions
Date: Sat, 4 Sep 2021 15:05:03 -0500	[thread overview]
Message-ID: <e3c5d767-6d31-3496-b2c3-d843a9e2d80f@oracle.com> (raw)
In-Reply-To: <20210903124800.30525-1-mlombard@redhat.com>

On 9/3/21 7:48 AM, 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 caused a regression in targetcli/rtslib because now a warning
> is triggered when performing a target restore that includes
> non-userbacked backstores, even if rtslib is not trying to change
> the attributes' values:
> 
> $ 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 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 EOPNOTSUPP 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.

Maybe you want to use -ENOSYS. Other lio sysfs files return that when the
operation is not supported. You could then handle all the warnings with
the same check.

  parent reply	other threads:[~2021-09-04 20:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 12:48 [PATCH] target: fix the pgr/alua_support_store functions Maurizio Lombardi
2021-09-04 17:43 ` Bodo Stroesser
2021-09-04 20:05 ` michael.christie [this message]
2021-09-06 11:37   ` Maurizio Lombardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3c5d767-6d31-3496-b2c3-d843a9e2d80f@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=bostroesser@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mlombard@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.