Re: [PATCH 2/2] scsi sd: Allow user to config cmd retries

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

 



On 9/21/20 10:22 PM, Bart Van Assche wrote:
> On 2020-09-21 11:48, Mike Christie wrote:
>> equivalent of a dm-mutlipath temp all paths down, or we just have to
>                      ^^^^^^^^^
>                      multipath?

Will fix.

> 
>> +static ssize_t
>> +max_retries_store(struct device *dev, struct device_attribute *attr,
>> +		  const char *buf, size_t count)
>> +{
>> +	struct scsi_disk *sdkp = to_scsi_disk(dev);
>> +	struct scsi_device *sdev = sdkp->device;
>> +	int retries;
>> +
>> +	if (sscanf(buf, "%d\n", &retries) != 1)
>> +		return -EINVAL;
> 
> Does the above code return 0 if a user uses echo -n to write into the
> max_retries attribute? If so, how about supporting echo -n?
> 
> Isn't kstrtoint() recommended over sscanf() in sysfs store callbacks?
> 

I'm not sure.

A dumb mistake on my part is that I had copied scsi_sysfs.c which uses sscanf but now that you mention it I see sd.c uses kstr*. I'll switch to kstr which also handles your \n comment too.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux