Commit 8d99f83b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

rescan_partitions(): make device capacity errors non-fatal

Herton Krzesinski reports that the error-checking changes in
04ebd4ae ("block/ioctl.c and
fs/partition/check.c: check value returned by add_partition") cause his
buggy USB camera to no longer mount.  "The camera is an Olympus X-840.
The original issue comes from the camera itself: its format program
creates a partition with an off by one error".

Buggy devices happen.  It is better for the kernel to warn and to proceed
with the mount.
Reported-by: default avatarHerton Ronaldo Krzesinski <herton@mandriva.com.br>
Cc: Abdel Benamrouche <draconux@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 42cde430
...@@ -499,9 +499,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) ...@@ -499,9 +499,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
if (!size) if (!size)
continue; continue;
if (from + size > get_capacity(disk)) { 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); disk->disk_name, p);
continue;
} }
res = add_partition(disk, p, from, size, state->parts[p].flags); res = add_partition(disk, p, from, size, state->parts[p].flags);
if (res) { if (res) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment