linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: Jens Axboe <axboe@suse.de>
Cc: linux-scsi@vger.kernel.org, Anton Blanchard <anton@samba.org>
Subject: Re: drivers/block/scsi_ioctl problem
Date: Fri, 07 Oct 2005 09:13:51 -0500	[thread overview]
Message-ID: <4346829F.7050009@us.ibm.com> (raw)
In-Reply-To: <20041216063218.GA22982@suse.de>

Jens,

Looks like this patch got dropped for some reason.

Brian

Jens Axboe wrote:
> On Wed, Dec 15 2004, Brian King wrote:
> 
>>Brian King wrote:
>>
>>>>It was added to be able to find out which opcode was rejected and thus
>>>>caused an application malfunction. It dumps the specific opcode only
>>>>once, is that such a huge problem?
>>>
>>>
>>>Ok. I didn't realize that it was only dumped once. That's not as bad. I 
>>>guess it might be better if it were only dumped if the op actually failed.
>>
>>How about something like this...
> 
> 
>>Currently if an SG_IO ioctl is issued to a block device with an
>>unknown opcode, an error is logged. This error is logged regardless
>>the device successfully processes the command or not. This results in
>>an error getting logged for each unknown opcode ever issued. This patch
>>changes this policy and only prints the unknown opcode if the command
>>fails.
> 
> 
> How about just moving it after the CAP_SYS_RAWIO check, so that it only
> logs for commands we explicitly reject? The purpose of the opcode dump
> is not to log failed commands (the app should do that itself), but
> mainly why a specific opcode was _not_ sent to the drive. This is
> something you cannot always directly gauge, unless you have the source
> for the app. And even then you have to dig :-)
> 
> ===== drivers/block/scsi_ioctl.c 1.62 vs edited =====
> --- 1.62/drivers/block/scsi_ioctl.c	2004-11-20 01:50:56 +01:00
> +++ edited/drivers/block/scsi_ioctl.c	2004-12-16 07:30:39 +01:00
> @@ -199,14 +199,14 @@
>  			return 0;
>  	}
>  
> +	/* And root can do any command.. */
> +	if (capable(CAP_SYS_RAWIO))
> +		return 0;
> +
>  	if (!(type & CMD_WARNED)) {
>  		cmd_type[cmd[0]] = CMD_WARNED;
>  		printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
>  	}
> -
> -	/* And root can do any command.. */
> -	if (capable(CAP_SYS_RAWIO))
> -		return 0;
>  
>  	/* Otherwise fail it with an "Operation not permitted" */
>  	return -EPERM;
> 
> 


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

  parent reply	other threads:[~2005-10-07 14:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 23:49 drivers/block/scsi_ioctl problem Brian King
2004-12-15  5:32 ` Douglas Gilbert
2004-12-15  7:18 ` Jens Axboe
2004-12-15 19:13   ` Brian King
2004-12-15 22:44     ` Brian King
2004-12-16  6:32       ` Jens Axboe
2004-12-16 16:31         ` Brian King
2005-10-07 14:13         ` Brian King [this message]
2005-10-07 17:41           ` Jens Axboe

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=4346829F.7050009@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=anton@samba.org \
    --cc=axboe@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).