From 0b8612cab0845680dae860ef3ee72115e0a1e88f Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 24 Jan 2022 22:30:44 +0300 Subject: [PATCH] scst_vdisk: Always mark manually set thin_provisioned sysfs attributes as [key] The thin_provisioned != dev_thin_provisioned condition isn't the best way for marking manually set thin_provisioned attribute. ----------------------------------- | thin_prov | dev_thin_prov | key | ---------------------------------- | 0, 1 | 0 | No | ----------------------------------- | 1 | 1 | No | ----------------------------------- | 0 | 1 | Yes | ----------------------------------- The thin_prov=1, dev_thin_prov=0 case leads to thin_prov will be set to 0 due to internal checking. So, it's possible to see the value of the thin_provisioned attribute via scstadmin only in the one case (3 row). It's especially unclear for the fileio devices, because they support thin provisioning only when the corresponding attribute is manually set. Thus, to clarify the using of the thin_provisioned attribute always display it when manually set. --- scst/src/dev_handlers/scst_vdisk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 0ef14fc5d..3514fb949 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -7944,9 +7944,7 @@ static ssize_t vdisk_sysfs_tp_show(struct kobject *kobj, virt_dev = dev->dh_priv; pos = sprintf(buf, "%d\n%s", virt_dev->thin_provisioned, - virt_dev->thin_provisioned_manually_set && - (virt_dev->thin_provisioned != - virt_dev->dev_thin_provisioned) ? + virt_dev->thin_provisioned_manually_set ? SCST_SYSFS_KEY_MARK "\n" : ""); TRACE_EXIT_RES(pos);