Linux block layer
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@wdc.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, Christoph Hellwig <hch@lst.de>,
	"Bart Van Assche" <bart.vanassche@wdc.com>,
	Hongxu Jia <hongxu.jia@windriver.com>
Subject: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
Date: Wed, 1 Nov 2017 15:31:49 -0700	[thread overview]
Message-ID: <20171101223149.27593-1-bart.vanassche@wdc.com> (raw)

The changes introduced through commit 82ed4db499b8 assume that the
sense buffer pointer in struct scsi_request is initialized for all
requests - passthrough and filesystem requests. Hence make sure
that that pointer is initialized for filesystem requests. Remove
the memset() call that clears .cmd because the scsi_req_init()
call in ide_initialize_rq() already initializes the .cmd.

Fixes: commit 82ed4db499b8 ("block: split scsi_request out of struct request")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hongxu Jia <hongxu.jia@windriver.com>
---
 drivers/ide/ide-cd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index a7355ab3bb22..09b5bdb1af64 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1328,8 +1328,7 @@ static int ide_cdrom_prep_fs(struct request_queue *q, struct request *rq)
 	unsigned long blocks = blk_rq_sectors(rq) / (hard_sect >> 9);
 	struct scsi_request *req = scsi_req(rq);
 
-	scsi_req_init(req);
-	memset(req->cmd, 0, BLK_MAX_CDB);
+	q->initialize_rq_fn(rq);
 
 	if (rq_data_dir(rq) == READ)
 		req->cmd[0] = GPCMD_READ_10;
-- 
2.14.3

             reply	other threads:[~2017-11-01 22:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 22:31 Bart Van Assche [this message]
2017-11-01 22:33 ` [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer Bart Van Assche
2017-11-02  2:36 ` Hongxu Jia
2017-11-02 14:49   ` Bart Van Assche
2017-11-02 14:28 ` 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=20171101223149.27593-1-bart.vanassche@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=hongxu.jia@windriver.com \
    --cc=linux-block@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