On 4/5/23 04:28, Igor Pylypiv wrote: >> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c >> index 4994148e685b..9a54b2c0fee7 100644 >> --- a/drivers/scsi/scsi_sysfs.c >> +++ b/drivers/scsi/scsi_sysfs.c >> @@ -1222,6 +1222,36 @@ static DEVICE_ATTR(queue_ramp_up_period, S_IRUGO | S_IWUSR, >> sdev_show_queue_ramp_up_period, >> sdev_store_queue_ramp_up_period); >> >> +static ssize_t sdev_show_cdl_enable(struct device *dev, >> + struct device_attribute *attr, char *buf) >> +{ >> + struct scsi_device *sdev = to_scsi_device(dev); >> + >> + return sysfs_emit(buf, "%d\n", (int)sdev->cdl_enable); >> +} >> + >> +static ssize_t sdev_store_cdl_enable(struct device *dev, >> + struct device_attribute *attr, >> + const char *buf, size_t count) >> +{ >> + int ret; >> + bool v; >> + >> + if (!capable(CAP_SYS_ADMIN)) >> + return -EACCES; > CAP_SYS_ADMIN seems be too restrictive. NCQ PRIO (ncq_prio_enable) does not > require CAP_SYS_ADMIN. Since NCQ PRIO and CDL are mutually exclusive a user > should be able to toggle both features. Indeed, we can have CDL be the same as NCQ prio. We can remove this SYS_CAP_ADMIN check.