Skip to contentSkip to conversation

restore BLKRRPART semantics

PATCH New Andries Brouwer 1 participant 1 message Dec 7, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Andries

fs/partitions/check.c +1 -1
diff -uprN -X /linux/dontdiff a/fs/partitions/check.c b/fs/partitions/check.c
@@ -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;