Commit b34fbc4c authored by Martin Pool's avatar Martin Pool Committed by Linus Torvalds

[PATCH] lost error code in rescan_partitions

This fixes a path where an error from reloading the partition table could be
lost.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c3036752
......@@ -395,7 +395,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
if (disk->fops->revalidate_disk)
disk->fops->revalidate_disk(disk);
if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
return res;
return -EIO;
for (p = 1; p < state->limit; p++) {
sector_t size = state->parts[p].size;
sector_t from = state->parts[p].from;
......@@ -408,7 +408,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
#endif
}
kfree(state);
return res;
return 0;
}
unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
......
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