Commit 6695ad97 authored by Andries E. Brouwer's avatar Andries E. Brouwer Committed by Linus Torvalds

[PATCH] restore BLKRRPART semantics

In 2.6.8 the code for the BLKRRPART ioctl was changed
to return EIO when no partitions were found, such as
on an empty disk. This breaks some partitioning programs
and is also confusing: "Input/Output error" while in fact
nothing was wrong with this brand new all blank disk.

This restores old behaviour.
parent ddc6d43e
......@@ -378,7 +378,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 -EIO;
return 0;
for (p = 1; p < state->limit; p++) {
sector_t size = state->parts[p].size;
sector_t from = state->parts[p].from;
......
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