Partition check considered as error is breaking mounting in 2.6.27
Review int rescan_partitions(struct gendisk *disk, struct · line 504
Quoted 9 lines · Herton Ronaldo Krzesinski
+++
b/fs/partitions/check.c(quoted diff) +2
-1@@ -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"
", trimmed\n",
Review int rescan_partitions(struct gendisk *disk, struct · line 505
Quoted 1 line
(quoted diff) +0
-0disk->disk_name, p);
Add "size = get_capacity(disk) - from" here? (Possibly using a cached value for get_capacity(disk)?)
Quoted 12 lines · On Saturday 13 September 2008 06:24:27 Bodo Eggert wrote:
Review int rescan_partitions(struct gendisk *disk, struct · line 504
Quoted 9 lines · Herton Ronaldo Krzesinski
+++
b/fs/partitions/check.c(quoted diff) +2
-1@@ -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"", trimmed\n",
Quoted 4 lines
Review int rescan_partitions(struct gendisk *disk, struct · line 505
Quoted 1 line
(quoted diff) +0
-0disk->disk_name, p);Add "size =
get_capacity(disk)- from" here? (Possibly using a cached value forget_capacity(disk)?)
Trim was already proposed here before (not accepted):
http://lkml.org/lkml/2006/10/12/364
--
[]'s
Herton
Quoted 13 lines · Herton Ronaldo Krzesinski
Quoted 12 lines · On Saturday 13 September 2008 06:24:27 Bodo Eggert wrote:
Review int rescan_partitions(struct gendisk *disk, struct · line 504
Quoted 9 lines · Herton Ronaldo Krzesinski
+++
b/fs/partitions/check.c(quoted diff) +2
-1@@ -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"", trimmed\n",
Quoted 7 lines
Quoted 4 lines
Review int rescan_partitions(struct gendisk *disk, struct · line 505
Quoted 1 line
(quoted diff) +0
-0disk->disk_name, p);Add "size =
get_capacity(disk)- from" here? (Possibly using a cached value forget_capacity(disk)?)Trim was already proposed here before (not accepted):
http://lkml.org/lkml/2006/10/12/364
Because of - as far as I read - possible special-case-forensic-situations and possible meddling-with-the-jumper.
IMO:
a) If you need fancy partition handling, you can do it in userspace. Copying a few MB to a completely different machine, expecting it to work correctly while depending on the partition numbering to stay the same is just stupid, and it won't work if you mount by path, anyway. It won't work for extended partitions, too, if they don't start in the copied area, because they are a chain of partition tables.
Ordinary users need a correctly-working, non-logspewing ("Access beyond end of disk") system, including the possibility to correctly create filesystems or to use md on the disks. Having an IO-error-area at the end of the partition won't exactly help, but maybe destroy the HAL-automounted-using-the-wrong-options* filesystem.
Advanced users like me can set up a system in qemu, transfer it to a temporary directory, start the old system into /bin/sh, make some bind mounts and start the new system.
I might also copy one disk onto two disks, planning to concatenate the split partition using dmsetup.
Even more advanced users do forensics. Do they really need us to prevent partition renumbering, as long as there ia a hex editor to trim the partitions? Can't they just write a small program to fix these partitions and run it after dd finished? Or create an intrd doing what they want? Or wouldn't they be be better of with something like "hda.size=0815"?
(*BTW: Is there any documentation for the pile-of-HAL-DBUS-KDE-and-stuff, which would allow me to actually configure it, and possibly unmount the devices without sudo?)
b) If there is a soft-clipped disk, find out the unclipped size (and unclip it on finding a large partition, if possible and if the partition is not "hidden").
If you need to enter a password, the partial partitions should be read-only and be switched to read-write after entering the password. Having a corrupted fs because of entering a wrong password is not a good start for a day. (Yes, my suggestion to just clip it was not enough.)
If you should ever need to access a partition exceeding the true disk size, you can always use dmsetup or losetup. And don't write to it until you've copied all the data you want. And especially dont complain about resulting corruptions.
Quoted 5 lines · Bodo Eggert
Ordinary users need a correctly-working, non-logspewing ("Access beyond
end of disk") system, including the possibility to correctly create
filesystems or to use md on the disks. Having an IO-error-area at the end
of the partition won't exactly help, but maybe destroy the HAL-automounted-using-the-wrong-options* filesystem.
It's not clear that "ordinary users" ever have this problem. It seems to happen *only* when using a drive which has something which looks like a partition table but isn't, or is a defective partition table, or will only work when diddling with HPA magic.
And should some naive user be trying to use such a drive, it seems better to tell them, to beat them over the head with the problem, because if you hide the problem those users are least likely to be able to recover when problems arise.
I'm not against some sensible recovery, I just don't agree that "pretend it isn't wrong" is a good default solution.
Signature · 3 lines
Bill Davidsen <[email protected]> "We have more to fear from the bungling of the incompetent than from the machinations of the wicked." - from Slashdot