public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Joern Quillman <quillman@fbihome.de>, linux-scsi@vger.kernel.org
Subject: Re: Spinup of SCSI Disks: allow_restart won't work on 2.6.18
Date: Mon, 20 Nov 2006 19:54:08 -0500	[thread overview]
Message-ID: <45624E30.5080605@torque.net> (raw)
In-Reply-To: <45624009.3040208@s5r6.in-berlin.de>

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

  reply	other threads:[~2006-11-21  0:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 17:38 Spinup of SCSI Disks: allow_restart won't work on 2.6.18 Joern Quillman
2006-11-17 21:44 ` Joern Quillmann
2006-11-17 23:34   ` Stefan Richter
2006-11-17 23:36     ` Stefan Richter
2006-11-20 10:52     ` Joern Quillman
2006-11-20 11:48       ` Stefan Richter
2006-11-20 22:32         ` Joern Quillman
2006-11-20 23:53           ` Stefan Richter
2006-11-21  0:54             ` Douglas Gilbert [this message]
2006-11-21  4:20               ` James Bottomley
2006-11-21  8:12                 ` Stefan Richter
2006-11-21 14:41               ` Brian King
2006-11-21 20:34                 ` [PATCH] scsi: sd: configurable allow_restart attribute for all device types Stefan Richter
2006-11-21  1:09             ` Spinup of SCSI Disks: allow_restart won't work on 2.6.18 Joern Quillmann
2006-11-21 20:49               ` Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45624E30.5080605@torque.net \
    --to=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=quillman@fbihome.de \
    --cc=stefanr@s5r6.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox