Re: [PATCH 03/12] sd: simplify the ZBC case in provisioning_mode_store
- To: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>, "Martin K. Petersen" <martin.petersen@oracle.com>
- Cc: Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Josef Bacik <josef@toxicpanda.com>, Ilya Dryomov <idryomov@gmail.com>, Dongsheng Yang <dongsheng.yang@easystack.cn>, Roger Pau Monné <roger.pau@citrix.com>, linux-um@lists.infradead.org, linux-block@vger.kernel.org, nbd@other.debian.org, ceph-devel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org
- Subject: Re: [PATCH 03/12] sd: simplify the ZBC case in provisioning_mode_store
- From: Damien Le Moal <dlemoal@kernel.org>
- Date: Wed, 29 May 2024 17:07:53 +0900
- Message-id: <[🔎] 24cad983-a1a0-4983-989d-79bcc9fd8a0a@kernel.org>
- In-reply-to: <[🔎] 20240529050507.1392041-4-hch@lst.de>
- References: <[🔎] 20240529050507.1392041-1-hch@lst.de> <[🔎] 20240529050507.1392041-4-hch@lst.de>
On 5/29/24 14:04, Christoph Hellwig wrote:
> Don't reset the discard settings to no-op over and over when a user
> writes to the provisioning attribute as that is already the default
> mode for ZBC devices. In hindsight we should have made writing to
> the attribute fail for ZBC devices, but the code has probably been
> around for far too long to change this now.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/sd.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 3dff9150ce11e2..15d0035048d902 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -461,14 +461,13 @@ provisioning_mode_store(struct device *dev, struct device_attribute *attr,
> if (!capable(CAP_SYS_ADMIN))
> return -EACCES;
>
> - if (sd_is_zoned(sdkp)) {
> - sd_config_discard(sdkp, SD_LBP_DISABLE);
> - return count;
> - }
> -
> if (sdp->type != TYPE_DISK)
> return -EINVAL;
>
> + /* ignore the proivisioning mode for ZBB devices */
s/proivisioning/provisioning
s/ZBB/ZBC
With that fixed,
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> + if (sd_is_zoned(sdkp))
> + return count;
> +
> mode = sysfs_match_string(lbp_mode, buf);
> if (mode < 0)
> return -EINVAL;
--
Damien Le Moal
Western Digital Research
Reply to: