Linux block layer
 help / color / mirror / Atom feed
* [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
@ 2017-11-01 22:31 Bart Van Assche
  2017-11-01 22:33 ` Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-11-01 22:31 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche, Hongxu Jia

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
  2017-11-01 22:31 [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer Bart Van Assche
@ 2017-11-01 22:33 ` Bart Van Assche
  2017-11-02  2:36 ` Hongxu Jia
  2017-11-02 14:28 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-11-01 22:33 UTC (permalink / raw)
  To: axboe@kernel.dk
  Cc: hch@lst.de, linux-block@vger.kernel.org, hongxu.jia@windriver.com

T24gV2VkLCAyMDE3LTExLTAxIGF0IDE1OjMxIC0wNzAwLCBCYXJ0IFZhbiBBc3NjaGUgd3JvdGU6
DQo+IFRoZSBjaGFuZ2VzIGludHJvZHVjZWQgdGhyb3VnaCBjb21taXQgODJlZDRkYjQ5OWI4IGFz
c3VtZSB0aGF0IHRoZQ0KPiBzZW5zZSBidWZmZXIgcG9pbnRlciBpbiBzdHJ1Y3Qgc2NzaV9yZXF1
ZXN0IGlzIGluaXRpYWxpemVkIGZvciBhbGwNCj4gcmVxdWVzdHMgLSBwYXNzdGhyb3VnaCBhbmQg
ZmlsZXN5c3RlbSByZXF1ZXN0cy4gSGVuY2UgbWFrZSBzdXJlDQo+IHRoYXQgdGhhdCBwb2ludGVy
IGlzIGluaXRpYWxpemVkIGZvciBmaWxlc3lzdGVtIHJlcXVlc3RzLiBSZW1vdmUNCj4gdGhlIG1l
bXNldCgpIGNhbGwgdGhhdCBjbGVhcnMgLmNtZCBiZWNhdXNlIHRoZSBzY3NpX3JlcV9pbml0KCkN
Cj4gY2FsbCBpbiBpZGVfaW5pdGlhbGl6ZV9ycSgpIGFscmVhZHkgaW5pdGlhbGl6ZXMgdGhlIC5j
bWQuDQoNCkhlbGxvIEplbnMsDQoNClBsZWFzZSBub3RlIHRoYXQgdGhpcyBwYXRjaCBhcHBsaWVz
IG9uIHRvcCBvZiB5b3VyIGZvci1saW51cyBicmFuY2gNCmJ1dCBpcyBpbnRlbmRlZCBmb3Iga2Vy
bmVsIHY0LjE1Lg0KDQpUaGFua3MsDQoNCkJhcnQu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
  2017-11-01 22:31 [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer Bart Van Assche
  2017-11-01 22:33 ` 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
  2 siblings, 1 reply; 5+ messages in thread
From: Hongxu Jia @ 2017-11-02  2:36 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe; +Cc: linux-block, Christoph Hellwig

Apply this patch, and the test on my platform is passed.

//Hongxu

On 2017年11月02日 06:31, Bart Van Assche wrote:
> 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;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
  2017-11-01 22:31 [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer Bart Van Assche
  2017-11-01 22:33 ` Bart Van Assche
  2017-11-02  2:36 ` Hongxu Jia
@ 2017-11-02 14:28 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2017-11-02 14:28 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-block, Christoph Hellwig, Hongxu Jia

On 11/01/2017 04:31 PM, Bart Van Assche wrote:
> 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.

I'll queue this up for 4.15, post the initial merge.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer
  2017-11-02  2:36 ` Hongxu Jia
@ 2017-11-02 14:49   ` Bart Van Assche
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-11-02 14:49 UTC (permalink / raw)
  To: hongxu.jia@windriver.com, axboe@kernel.dk
  Cc: hch@lst.de, linux-block@vger.kernel.org

T24gVGh1LCAyMDE3LTExLTAyIGF0IDEwOjM2ICswODAwLCBIb25neHUgSmlhIHdyb3RlOg0KPiBB
cHBseSB0aGlzIHBhdGNoLCBhbmQgdGhlIHRlc3Qgb24gbXkgcGxhdGZvcm0gaXMgcGFzc2VkLg0K
DQpUaGFuayB5b3UgZm9yIGhhdmluZyB0ZXN0ZWQgdGhpcyBwYXRjaC4gRG9lcyB0aGlzIG1lYW4g
dGhhdCB5b3UgYXJlIE9LDQp3aXRoIGFkZGluZyB0aGUgZm9sbG93aW5nIHRvIHRoaXMgcGF0Y2g6
IFRlc3RlZC1ieTogSG9uZ3h1IEppYSA8aG9uZ3h1LmppYUB3aW5kcml2ZXIuY29tPiA/DQoNCkJh
cnQuDQo=

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-02 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 22:31 [PATCH] ide: Make ide_cdrom_prep_fs() initialize the sense buffer pointer Bart Van Assche
2017-11-01 22:33 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox