All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Tony Battersby <tonyb@cybernetics.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-block@vger.kernel.org, Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: Re: [PATCH] bsg: fix bogus EINVAL on non-data commands
Date: Wed, 11 Jul 2018 08:37:16 +0200	[thread overview]
Message-ID: <20180711063716.GA7934@lst.de> (raw)
In-Reply-To: <7730dcb2-7e69-3fc5-7eeb-4bbcf5091f14@cybernetics.com>

On Tue, Jul 10, 2018 at 12:52:24PM -0400, Tony Battersby wrote:
> Fix a regression introduced in Linux kernel 4.17 where sending a SCSI
> command that does not transfer data (such as TEST UNIT READY) via
> /dev/bsg/* results in EINVAL.
> 
> Fixes: 17cb960f29c2 ("bsg: split handling of SCSI CDBs vs transport requeues")
> Cc: <stable@vger.kernel.org> # 4.17+
> Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
> ---
> diff --git a/block/bsg.c b/block/bsg.c
> index 66602c4..b16ab6f 100644
> --- a/block/bsg.c
> +++ b/block/bsg.c
> @@ -268,7 +268,7 @@ bsg_map_hdr(struct request_queue *q, str
>  		ret = blk_rq_map_user(q, rq, NULL, uptr64(hdr->din_xferp),
>  				hdr->din_xfer_len, GFP_KERNEL);
>  	} else {
> -		ret = blk_rq_map_user(q, rq, NULL, NULL, 0, GFP_KERNEL);
> +		ret = 0;
>  	}

We can remove the else branch entirely as ret already is 0 here.

Otherwise this looks fine and restores the previous behavior:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2018-07-11  6:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10 16:52 [PATCH] bsg: fix bogus EINVAL on non-data commands Tony Battersby
2018-07-11  6:37 ` Christoph Hellwig [this message]
2018-07-11 14:46   ` [PATCH v2] " Tony Battersby
2018-07-11 14:48     ` 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=20180711063716.GA7934@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=hare@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=tonyb@cybernetics.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.