Commit 96408b92 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] Work around devices with bogus media change indication on the first open

What that patch does is making the first open _always_ assume that we need to
revalidate/reread partition table and kills partition-parsing in
register_disk(); instead we just have it do open/close and let the
revalidation path in open do the job.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 877bc275
......@@ -325,10 +325,8 @@ static void disk_sysfs_symlinks(struct gendisk *disk)
/* Not exported, helper to add_disk(). */
void register_disk(struct gendisk *disk)
{
struct parsed_partitions *state;
struct block_device *bdev;
char *s;
int j;
int err;
strlcpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN);
......@@ -358,24 +356,9 @@ void register_disk(struct gendisk *disk)
if (!bdev)
return;
bdev->bd_invalidated = 1;
if (blkdev_get(bdev, FMODE_READ, 0) < 0)
return;
state = check_partition(disk, bdev);
if (state) {
for (j = 1; j < state->limit; j++) {
sector_t size = state->parts[j].size;
sector_t from = state->parts[j].from;
if (!size)
continue;
add_partition(disk, j, from, size);
#ifdef CONFIG_BLK_DEV_MD
if (!state->parts[j].flags)
continue;
md_autodetect_dev(bdev->bd_dev+j);
#endif
}
kfree(state);
}
blkdev_put(bdev);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment