target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bodo Stroesser <bostroesser@gmail.com>
To: Maurizio Lombardi <mlombard@redhat.com>, martin.petersen@oracle.com
Cc: michael.christie@oracle.com, target-devel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH V2] target: fix the pgr/alua_support_store functions
Date: Mon, 6 Sep 2021 17:44:36 +0200	[thread overview]
Message-ID: <b1a05684-92a5-f209-a81f-96a1cfc4ea49@gmail.com> (raw)
In-Reply-To: <20210906151809.52811-1-mlombard@redhat.com>

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@redhat.com>
> ---

Reviewed-by: Bodo Stroesser <bostroesser@gmail.com>

  reply	other threads:[~2021-09-06 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 15:18 [PATCH V2] target: fix the pgr/alua_support_store functions Maurizio Lombardi
2021-09-06 15:44 ` Bodo Stroesser [this message]
2021-09-14  3:43 ` Martin K. Petersen

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=b1a05684-92a5-f209-a81f-96a1cfc4ea49@gmail.com \
    --to=bostroesser@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).