public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org
Subject: Re: block: remove dead code in scsi_ioctl:blk_verify_command
Date: Thu, 29 May 2014 13:39:40 -0600	[thread overview]
Message-ID: <53878CFC.2090506@kernel.dk> (raw)
In-Reply-To: <20140529191130.GA10405@redhat.com>

On 05/29/2014 01:11 PM, Dave Jones wrote:
> filter gets assigned the address of blk_default_cmd_filter on
> entry to this function, so the !filter condition can never be true.
> 
> Signed-off-by: Dave Jones <davej@redhat.com>
> 
> diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
> index 26487972ac54..9c28a5b38042 100644
> --- a/block/scsi_ioctl.c
> +++ b/block/scsi_ioctl.c
> @@ -205,10 +205,6 @@ int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm)
>  	if (capable(CAP_SYS_RAWIO))
>  		return 0;
>  
> -	/* if there's no filter set, assume we're filtering everything out */
> -	if (!filter)
> -		return -EPERM;
> -
>  	/* Anybody who can open the device can do a read-safe command */
>  	if (test_bit(cmd[0], filter->read_ok))
>  		return 0;

Thanks Dave, applied.

-- 
Jens Axboe


      reply	other threads:[~2014-05-29 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29 19:11 block: remove dead code in scsi_ioctl:blk_verify_command Dave Jones
2014-05-29 19:39 ` Jens Axboe [this message]

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=53878CFC.2090506@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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