[PATCH] sg: pass the device name to blk_trace_setup

Subsystems: scsi sg driver, scsi subsystem, the rest

STALE1811d LANDED

Landed in mainline as 1d1cf156dc17 on 2021-08-25.

3 messages, 3 authors, 2021-08-25 · open the first message on its own page

[PATCH] sg: pass the device name to blk_trace_setup

From: Christoph Hellwig <hch@lst.de>
Date: 2021-08-25 07:55:47

Fix a regression that passd a NULL device name to blk_trace_setup
accidentally.

Fixes: aebbb5831fbd ("sg: do not allocate a gendisk")
Reported-by: syzbot+f74aa89114a236643919@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 477267add49d..d5889b4f0fd4 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1118,7 +1118,7 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
 		return put_user(max_sectors_bytes(sdp->device->request_queue),
 				ip);
 	case BLKTRACESETUP:
-		return blk_trace_setup(sdp->device->request_queue, NULL,
+		return blk_trace_setup(sdp->device->request_queue, sdp->name,
 				       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
 				       NULL, p);
 	case BLKTRACESTART:
-- 
2.30.2

Re: [PATCH] sg: pass the device name to blk_trace_setup

From: Max Gurtovoy <mgurtovoy@nvidia.com>
Date: 2021-08-25 10:08:57

On 8/25/2021 10:54 AM, Christoph Hellwig wrote:
quoted hunk
Fix a regression that passd a NULL device name to blk_trace_setup
accidentally.

Fixes: aebbb5831fbd ("sg: do not allocate a gendisk")
Reported-by: syzbot+f74aa89114a236643919@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
  drivers/scsi/sg.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 477267add49d..d5889b4f0fd4 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1118,7 +1118,7 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
  		return put_user(max_sectors_bytes(sdp->device->request_queue),
  				ip);
  	case BLKTRACESETUP:
-		return blk_trace_setup(sdp->device->request_queue, NULL,
+		return blk_trace_setup(sdp->device->request_queue, sdp->name,
  				       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
  				       NULL, p);
  	case BLKTRACESTART:
Looks good,

Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>

Re: [PATCH] sg: pass the device name to blk_trace_setup

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-08-25 12:46:55

On 8/25/21 1:54 AM, Christoph Hellwig wrote:
Fix a regression that passd a NULL device name to blk_trace_setup
accidentally.
Applied, thanks.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help