[PATCH] restore BLKRRPART semantics

From: Andries Brouwer
Date: Tue Dec 07 2004 - 06:22:15 EST


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.

Andries

diff -uprN -X /linux/dontdiff a/fs/partitions/check.c b/fs/partitions/check.c
--- a/fs/partitions/check.c 2004-12-04 16:18:22.000000000 +0100
+++ b/fs/partitions/check.c 2004-12-07 12:26:28.000000000 +0100
@@ -378,7 +378,7 @@ int rescan_partitions(struct gendisk *di
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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/