Re: Spinup of SCSI Disks: allow_restart won't work on 2.6.18

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

 



Stefan Richter wrote:
> Joern Quillman wrote:
>>>> One problem left. I still can't set or unset the flag with echo even
>>>> on 2.6.19-rc6 (as root).
> ...
>> Permissions of the file are -rw-r--r--. Owner is of course root.
>> As I wrote before I can set/unset the flag without any problems when I
>> connect a dumb USB<->IDE
>> converter with kernel 2.6.18. Same with 2.6.19-rc6.
>>
>> The complete error message (sorry it's in german here) is:
>> "-bash: echo: write error: Das Argument ist ungueltig"
>>
>> Is there a way to do some debug on the internals to see why the
>> attribute isn't actually writeable? Do you need parts of the kernel log?
> 
> The responsible kernel code is drivers/scsi/sd.c::sd_store_allow_restart().
> 
> static ssize_t sd_store_allow_restart(struct class_device *cdev, const
> char *buf,
> 				      size_t count)
> {
> 	struct scsi_disk *sdkp = to_scsi_disk(cdev);
> 	struct scsi_device *sdp = sdkp->device;
> 
> 	if (!capable(CAP_SYS_ADMIN))
> 		return -EACCES;
> 
> 	if (sdp->type != TYPE_DISK)
> 		return -EINVAL;
> 
> 	sdp->allow_restart = simple_strtoul(buf, NULL, 10);
> 
> 	return count;
> }
> 
> 
> I think the solution is easy: Replace if (sdp->type != TYPE_DISK) by
> 
> 	if (sdp->type != TYPE_DISK && sdp->type != TYPE_RBC)

... but why have the condition at all? What other peripheral
device type should the _sd_ driver be handling??

Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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