Re: Partition check considered as error is breaking mounting in 2.6.27

From: Herton Ronaldo Krzesinski
Date: Fri Sep 12 2008 - 17:07:30 EST


On Friday 12 September 2008 17:27:54 Bob Copeland wrote:
> On Fri, Sep 12, 2008 at 4:14 PM, Herton Ronaldo Krzesinski
> <herton@xxxxxxxxxxxxxxx> wrote:
> > diff --git a/fs/partitions/check.c b/fs/partitions/check.c
> > index 7d6b34e..15c70df 100644
> > --- a/fs/partitions/check.c
> > +++ b/fs/partitions/check.c
> > @@ -499,9 +499,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
> > if (!size)
> > continue;
> > if (from + size > get_capacity(disk)) {
> > - printk(KERN_ERR " %s: p%d exceeds device capacity\n",
> > + printk(KERN_WARNING
> > + " %s: p%d exceeds device capacity\n",
> > disk->disk_name, p);
> > - continue;
>
> It might make sense to comment here that we intentionally want to add the
> partition anyway. That might keep someone from re-adding the continue (same
> patch has already come up at least 3 times).
>

Yes, here goes a new version:

___

fs/partition/check.c: revert part of commit 04ebd4aee52b06a2c38127d9208546e5b96f3a19

Fix regression introduced by commit 04ebd4aee52b06a2c38127d9208546e5b96f3a19,
where kernel changed behaviour making fatal the error when some partition
exceeds the limit of the device size. Some buggy devices become inacessible
because of errors in their partition table if the error is fatal.

This closes http://bugzilla.kernel.org/show_bug.cgi?id=11554

Signed-off-by: Herton Ronaldo Krzesinski <herton@xxxxxxxxxxxxxxx>

diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 7d6b34e..2dd346d 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -499,9 +499,13 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
if (!size)
continue;
if (from + size > get_capacity(disk)) {
- printk(KERN_ERR " %s: p%d exceeds device capacity\n",
+ printk(KERN_WARNING
+ " %s: p%d exceeds device capacity\n",
disk->disk_name, p);
- continue;
+ /* note: we don't want to break access to
+ * devices with buggy partition tables, so we
+ * don't want to fail here, just go on and
+ * add partition */
}
res = add_partition(disk, p, from, size, state->parts[p].flags);
if (res) {



--
[]'s
Herton
--
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/