提交 76e3a19d 编写于 作者: M Martin Peschke 提交者: James Bottomley

[SCSI] sg: fix device number in blktrace data

Hi,

we have run into an issue with blktrace being started for sg devices.
Please apply.

Thanks,
Martin

From: Martin Peschke <mpeschke@linux.vnet.ibm.com>

The device number denoting a generic SCSI devices (sg) in a blktrace
trace is broken; major and minor are always 0. It looks like
sdp->device->sdev_gendev.devt is not initialized properly.
The fix below uses other data to make up a valid device number,
similar to the way an sg device number is generated for sysfs output.
Reported-by: NStefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: NMartin Peschke <mpeschke@linux.vnet.ibm.com>
Acked-by: NDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 c2f9e49f
...@@ -1078,7 +1078,7 @@ sg_ioctl(struct inode *inode, struct file *filp, ...@@ -1078,7 +1078,7 @@ sg_ioctl(struct inode *inode, struct file *filp,
case BLKTRACESETUP: case BLKTRACESETUP:
return blk_trace_setup(sdp->device->request_queue, return blk_trace_setup(sdp->device->request_queue,
sdp->disk->disk_name, sdp->disk->disk_name,
sdp->device->sdev_gendev.devt, MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
(char *)arg); (char *)arg);
case BLKTRACESTART: case BLKTRACESTART:
return blk_trace_startstop(sdp->device->request_queue, 1); return blk_trace_startstop(sdp->device->request_queue, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册