From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Jens Axboe <axboe@kernel.dk>, Ric Wheeler <rwheeler@redhat.com>,
linux-iscsi@vger.kernel.org
Subject: Re: [PATCH 2/3] scsi: create an all-zero filter for scanners
Date: Wed, 12 Sep 2012 13:36:13 +0100 [thread overview]
Message-ID: <20120912133613.1255aa52@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1347449024-26387-3-git-send-email-pbonzini@redhat.com>
On Wed, 12 Sep 2012 13:23:43 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Using /dev/sg for scanners is blocked from unprivileged users. Reimplement
> this using customizable command filters, so that the sysfs knobs will work
> in this case too.
>
> Cc: linux-iscsi@vger.kernel.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> drivers/scsi/scsi_scan.c | 6 +++++-
> drivers/scsi/sg.c | 3 ---
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 56a9379..d168c15 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -773,13 +773,17 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
> }
>
> switch (sdev->type) {
> + case TYPE_SCANNER:
> + sdev->request_queue->cmd_filter =
> + kzalloc(sizeof(struct blk_cmd_filter), GFP_KERNEL);
> + /* fallthrough */
Is that really desireable in the kzalloc failing case ?
next prev parent reply other threads:[~2012-09-12 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 11:23 [PATCH 0/3] block: add queue-private command filter, editable via sysfs Paolo Bonzini
2012-09-12 11:23 ` [PATCH 1/3] block: add back queue-private command filter Paolo Bonzini
2012-09-12 11:23 ` [PATCH 2/3] scsi: create an all-zero filter for scanners Paolo Bonzini
2012-09-12 12:36 ` Alan Cox [this message]
2012-09-12 12:32 ` Paolo Bonzini
2012-09-12 11:23 ` [PATCH 3/3] block: add back command filter modification via sysfs Paolo Bonzini
2012-09-12 11:25 [PATCH 0/3] block: add queue-private command filter, editable " Paolo Bonzini
2012-09-12 11:25 ` [PATCH 2/3] scsi: create an all-zero filter for scanners Paolo Bonzini
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=20120912133613.1255aa52@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=James.Bottomley@HansenPartnership.com \
--cc=axboe@kernel.dk \
--cc=linux-iscsi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rwheeler@redhat.com \
--cc=tj@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).