public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Partition check considered as error is breaking mounting in  2.6.27
Date: Sat, 13 Sep 2008 11:54:44 -0400	[thread overview]
Message-ID: <gagno4$pp9$1@ger.gmane.org> (raw)
In-Reply-To: <20080912163416.112152e5.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Fri, 12 Sep 2008 13:56:49 -0300
> Herton Ronaldo Krzesinski <herton@mandriva.com.br> wrote:
> 
>> Recently I found a problem with a buggy camera that doesn't mount anymore with 
>> 2.6.27 (its memory is available via usb-storage), since commit 
>> 04ebd4aee52b06a2c38127d9208546e5b96f3a19
>>
>> 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, 
>> while the device reports that its memory has 42079 sectors, the partition 
>> table reports also that the only partition on the disk has the size of 42079, 
>> but it fails to account for the first sector in the memory that contains the 
>> partition table, so in the end the partition exceeds the limit of the device 
>> size (42080, first sector plus 42079 from the first partition).
>>
>> In previous kernels (2.6.26 and before), I still could mount and access the 
>> device (/dev/sdb1), although with the following errors:
> 
> Yeah.
> 
> Can you test this please?
> 
> From: Andrew Morton <akpm@linux-foundation.org>
> 
> Herton Krzesinski reports that the error-checking changes in
> 04ebd4aee52b06a2c38127d9208546e5b96f3a19 ("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: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
> Cc: Abdel Benamrouche <draconux@gmail.com>
> Cc: Jens Axboe <jens.axboe@oracle.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  fs/partitions/check.c |    1 -
>  1 file changed, 1 deletion(-)
> 
> diff -puN fs/partitions/check.c~rescan_partitions-make-device-capacity-errors-non-fatal fs/partitions/check.c
> --- a/fs/partitions/check.c~rescan_partitions-make-device-capacity-errors-non-fatal
> +++ a/fs/partitions/check.c
> @@ -540,7 +540,6 @@ int rescan_partitions(struct gendisk *di
>  		if (from + size > get_capacity(disk)) {
>  			printk(KERN_ERR " %s: p%d exceeds device capacity\n",
>  				disk->disk_name, p);
> -			continue;
>  		}
>  		res = add_partition(disk, p, from, size, state->parts[p].flags);
>  		if (res) {
> _
> 
I really like the patch Herton posted, with the big comment on why you don't 
want continue, to avoid repeating this conversation in a few years.

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot


  reply	other threads:[~2008-09-13 15:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 16:56 Partition check considered as error is breaking mounting in 2.6.27 Herton Ronaldo Krzesinski
2008-09-12 23:34 ` Andrew Morton
2008-09-13 15:54   ` Bill Davidsen [this message]
2008-09-13 22:56   ` Herton Ronaldo Krzesinski
  -- strict thread matches above, loose matches on Subject: below --
2008-09-12 17:01 Herton Ronaldo Krzesinski
2008-09-12 17:36 ` Alan Stern
2008-09-12 17:59   ` Bob Copeland
2008-09-12 18:21     ` Alan Stern
2008-09-12 18:02   ` Herton Ronaldo Krzesinski
2008-09-12 18:40     ` Alan Stern
2008-09-12 20:14       ` Herton Ronaldo Krzesinski
2008-09-12 20:17         ` Herton Ronaldo Krzesinski
2008-09-12 20:27         ` Bob Copeland
2008-09-12 21:07           ` Herton Ronaldo Krzesinski
2008-09-12 23:36             ` Andrew Morton
2008-09-12 23:46               ` David Brownell
2008-09-12 23:52                 ` Andrew Morton
2008-09-12 23:59                   ` David Brownell
2008-09-13  0:13                     ` Andrew Morton
2008-09-13  2:22                 ` Alan Stern
2008-10-08 16:01               ` Kay Sievers
2008-10-09 14:04                 ` Kay Sievers
2008-10-13  9:01                   ` Jens Axboe
2008-09-12 17:32 Toralf Förster
     [not found] <bblSy-60j-19@gated-at.bofh.it>
     [not found] ` <bbnhC-7Vd-5@gated-at.bofh.it>
2008-09-13  9:24   ` Bodo Eggert
2008-09-13 23:25     ` Herton Ronaldo Krzesinski
2008-09-14 12:36       ` Bodo Eggert
2008-09-15 17:01         ` Bill Davidsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gagno4$pp9$1@ger.gmane.org' \
    --to=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox