Commit 76e3a19d0691bbfcc559ce77ab3004818fab8f22

Authored by Martin Peschke
Committed by James Bottomley
1 parent c2f9e49f9b

[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: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1078,7 +1078,7 @@
1078 1078 case BLKTRACESETUP:
1079 1079 return blk_trace_setup(sdp->device->request_queue,
1080 1080 sdp->disk->disk_name,
1081   - sdp->device->sdev_gendev.devt,
  1081 + MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
1082 1082 (char *)arg);
1083 1083 case BLKTRACESTART:
1084 1084 return blk_trace_startstop(sdp->device->request_queue, 1);