Pete Zaitcev
51490c89f9
[SCSI] sr.c: Fix getting wrong size
...
Here's the problem. Try to do this on 2.6.12:
- Kill udev and HAL
- Insert a CD-ROM into a SCSI or USB CD-ROM drive
- Run dd if=/dev/scd0
- cat /sys/block/sr0/size
- Eject the CD, insert a different one
- Run dd if=/dev/scd0
This is likely to do "access beyond the end of device", if you let it
- cat /sys/block/sr0/size
This shows the size of a previous CD, even though dd was supposed
to revalidate the device.
- Run dd if=/dev/scd0
The second run of dd works correctly!
The bug was introduced in 2.5.31, when Al fixes the recursive opens
in partitioning. Before, the code worked like this:
- Block layer called cdrom_open directly
- cdrom_open called sr_open
- sr_open called check_disk_change
- check_disk_change called sr_media_change
- sr_media_change did cd->needs_disk_change=1
- before returning sr_open tested cd->needs_disk_change
and called get_sector_size.
In 2.6.12, the check_disk_change is called from cdrom_open only. Thus:
- Block layer calls sr_bd_open
- sr_bd_open calls cdrom_open
- cdrom_open calls sr_open
- sr_open tests cd->needs_disk_change, which wasn't set yet; returns
- cdrom_open calls check_disk_change
- check_disk_change calls sr_media_change
- sr_media_change does cd->needs_disk_change=1, but nobody cares
Acked by: Alexander Viro <aviro@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-08-28 11:14:12 -05:00
..
2005-08-28 11:14:07 -05:00
2005-08-15 09:19:23 -05:00
2005-04-16 15:20:36 -07:00
2005-06-20 15:15:35 -07:00
2005-07-27 16:26:08 -07:00
2005-08-28 11:14:11 -05:00
2005-08-12 12:09:32 -05:00
2005-06-26 08:31:47 -05:00
2005-07-07 18:24:07 -07:00
2005-07-27 22:31:35 -07:00
2005-07-27 16:26:08 -07:00
2005-06-27 21:52:47 -07:00
2005-04-16 15:20:36 -07:00
2005-06-27 21:52:47 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-18 12:32:20 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-20 15:15:35 -07:00
2005-04-16 20:09:43 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-08-08 09:55:39 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:03 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-28 00:08:00 -04:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-07-28 15:54:15 -04:00
2005-04-16 15:20:36 -07:00
2005-04-18 12:32:20 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-05-20 12:53:31 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-07-30 09:08:21 -05:00
2005-08-28 11:14:10 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-18 13:49:58 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-07-27 16:26:20 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:04:45 -05:00
2005-07-11 09:35:55 -05:00
2005-06-25 16:25:03 -07:00
2005-07-27 16:26:08 -07:00
2005-07-27 16:26:08 -07:00
2005-04-16 15:20:36 -07:00
2005-06-26 12:14:46 -05:00
2005-04-16 15:20:36 -07:00
2005-06-26 12:14:10 -05:00
2005-04-26 07:43:42 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:10 -05:00
2005-07-27 16:26:20 -07:00
2005-04-16 15:20:36 -07:00
2005-05-20 12:53:34 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:04:45 -05:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-18 13:50:23 -05:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-07-30 11:13:01 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-06-17 12:05:10 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:10 -05:00
2005-06-17 12:04:45 -05:00
2005-07-27 16:26:08 -07:00
2005-06-25 16:25:00 -07:00
2005-06-27 21:52:47 -07:00
2005-05-20 12:53:45 -05:00
2005-06-17 12:05:18 -05:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 18:42:23 -05:00
2005-04-16 20:09:43 -05:00
2005-07-26 13:28:47 -07:00
2005-06-27 00:47:48 -04:00
2005-05-29 14:48:20 -04:00
2005-07-06 12:55:20 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:04:45 -05:00
2005-06-17 12:04:45 -05:00
2005-05-20 12:53:50 -05:00
2005-04-16 15:20:36 -07:00
2005-07-26 13:28:47 -07:00
2005-06-26 12:16:24 -05:00
2005-07-06 12:55:20 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-07-27 16:26:08 -07:00
2005-06-17 12:05:10 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:10 -05:00
2005-06-17 12:04:45 -05:00
2005-04-16 20:09:43 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-20 15:15:08 -07:00
2005-04-16 15:20:36 -07:00
2005-07-27 16:26:08 -07:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:10 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-05-20 12:53:13 -05:00
2005-05-20 12:53:13 -05:00
2005-05-20 12:53:13 -05:00
2005-08-02 11:43:52 -05:00
2005-08-02 11:43:52 -05:00
2005-06-17 12:05:10 -05:00
2005-06-17 12:04:45 -05:00
2005-06-17 12:04:45 -05:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-06-26 08:31:47 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-05-26 21:54:27 -04:00
2005-06-04 00:40:40 -04:00
2005-04-16 15:20:36 -07:00
2005-05-26 21:54:27 -04:00
2005-06-09 03:06:22 -04:00
2005-05-26 21:54:27 -04:00
2005-06-09 03:10:56 -04:00
2005-05-26 21:54:27 -04:00
2005-05-26 21:54:27 -04:00
2005-05-26 21:54:27 -04:00
2005-05-29 14:24:57 -04:00
2005-04-16 15:20:36 -07:00
2005-06-24 00:06:43 -07:00
2005-04-16 15:20:36 -07:00
2005-08-12 11:40:50 -05:00
2005-07-30 11:10:24 -05:00
2005-07-30 11:10:24 -05:00
2005-07-30 11:10:24 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-26 12:17:24 -05:00
2005-04-16 15:20:36 -07:00
2005-07-30 11:13:01 -05:00
2005-04-16 15:20:36 -07:00
2005-07-30 11:10:24 -05:00
2005-08-14 17:21:27 -05:00
2005-04-16 15:20:36 -07:00
2005-08-14 17:21:27 -05:00
2005-04-16 15:20:36 -07:00
2005-08-12 12:27:44 -05:00
2005-04-18 13:49:58 -05:00
2005-04-16 15:20:36 -07:00
2005-07-14 11:25:17 -04:00
2005-06-17 12:05:10 -05:00
2005-06-17 12:04:45 -05:00
2005-07-30 11:10:24 -05:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 20:09:43 -05:00
2005-04-21 16:14:05 -04:00
2005-04-16 15:20:36 -07:00
2005-08-28 11:14:12 -05:00
2005-08-28 11:14:12 -05:00
2005-04-16 15:20:36 -07:00
2005-08-08 09:33:48 -05:00
2005-08-08 09:33:48 -05:00
2005-04-18 12:32:20 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-05-20 12:53:32 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-06-17 12:04:45 -05:00
2005-06-17 12:04:45 -05:00
2005-07-27 16:26:08 -07:00
2005-06-17 12:05:10 -05:00
2005-04-16 15:20:36 -07:00
2005-06-26 12:14:10 -05:00
2005-06-17 12:04:55 -05:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-17 12:05:18 -05:00
2005-04-16 15:20:36 -07:00