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

[PATCH 03/12] sd: simplify the ZBC case in provisioning_mode_store



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@xxxxxx>
---
 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 */
+       if (sd_is_zoned(sdkp))
+               return count;
+
        mode = sysfs_match_string(lbp_mode, buf);
        if (mode < 0)
                return -EINVAL;
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.