Re: [PATCH] sd: fix sysfs writes to "provisioning_mode" and "zeroing_mode"

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

 



On Mon, 2017-05-15 at 20:14 +0000, Bart Van Assche wrote:
> On Mon, 2017-05-15 at 15:13 -0400, Ewan D. Milne wrote:
> > From: "Ewan D. Milne" <emilne@xxxxxxxxxx>
> > 
> > Change to use strlen() of the desired string for the length
> > parameter to strncmp().  Otherwise one cannot simply use a
> > command like 'echo "writesame_16" > .../provisioning_mode'.
> > This patch makes sysfs writes consistent with other usage.
> 
> Hello Ewan,
> 
> Sorry but I don't like the approach of this patch. Have you considered
> to strip the whitespace from 'buf' with e.g. strim() such that strcmp()
> can be used instead of strncmp(buf, ..., strlen(...))?
> 
> Thanks,
> 
> Bart.

I think it's the '\n' that actually causes the problem.
But, what I think we should do is use the same technique everywhere.
So, are you suggesting we change all the other sysfs store routines?

The problem arises when scripts can manipulate some sysfs properties
but not others, and its not obvious why not.  It should be consistent.

Also any change has to be careful to avoid breaking existing scripts.

-Ewan





[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