02 Mar, 2012
1 commit
-
Since 2.6.39 (1196f8b), when a driver returns -ENOMEDIUM for open(),
__blkdev_get() calls rescan_partitions() to remove
in-kernel partition structures and raise KOBJ_CHANGE uevent.However it ends up calling driver's revalidate_disk without open
and could cause oops.In the case of SCSI:
process A process B
----------------------------------------------
sys_open
__blkdev_get
sd_open
returns -ENOMEDIUM
scsi_remove_device
rescan_partitions
sd_revalidate_disk
Oopses are reported here:
http://marc.info/?l=linux-scsi&m=132388619710052This patch separates the partition invalidation from rescan_partitions()
and use it for -ENOMEDIUM case.Reported-by: Huajun Li
Signed-off-by: Jun'ichi Nomura
Acked-by: Tejun Heo
Cc: stable@kernel.org
Signed-off-by: Jens Axboe
04 Jan, 2012
1 commit
-
Signed-off-by: Al Viro