public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] restore BLKRRPART semantics
@ 2004-12-07 11:18 Andries Brouwer
  0 siblings, 0 replies; only message in thread
From: Andries Brouwer @ 2004-12-07 11:18 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-07 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-07 11:18 [PATCH] restore BLKRRPART semantics Andries Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox