From: Randy Dunlap <randy.dunlap@oracle.com>
To: Neil Brown <neilb@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org, aeb@cwi.nl,
Jens Axboe <jens.axboe@oracle.com>
Subject: Re: Why aren't partitions limited to fit within the device?
Date: Sun, 15 Oct 2006 18:31:48 -0700 [thread overview]
Message-ID: <20061015183148.13f9d1da.randy.dunlap@oracle.com> (raw)
In-Reply-To: <17714.52626.667835.228747@cse.unsw.edu.au>
On Mon, 16 Oct 2006 10:08:50 +1000 Neil Brown wrote:
> On Friday October 13, alan@lxorguk.ukuu.org.uk wrote:
> > Ar Gwe, 2006-10-13 am 09:50 +1000, ysgrifennodd Neil Brown:
> > > So: Is there any good reason to not clip the partitions to fit
> > > within the device - and discard those that are completely beyond
> > > the end of the device??
> >
> > Its close but not quite the right approach
> >
> > > The patch at the end of the mail does that. Is it OK to submit this
> > > to mainline?
> >
> > No I think not. Any partition which is partly outside the disk should be
> > ignored entirely, that ensures it doesn't accidentally get mounted and
> > trashed by an HPA or similar mixup.
>
> Hmmm.. So Alan things a partially-outside-this-disk partition
> shouldn't show up at all, and Andries thinks it should.
> And both give reasonably believable justifications.
>
> Maybe we need a kernel parameter? How about this?
>
> NeilBrown
>
>
> -----------------------------
> Don't allow partitions to start or end beyond the end of the device.
>
> Corrupt partitions tables can cause wierd partitions that confuse
> programs. This is confusion that can be avoided.
>
> If a partition appears to start at or beyond the end of a device, we
> don't enable it.
> If it starts within the device but ends after the end, we clip it to
> fit within the device.
>
> Not enabling partitions does not affect partition numbering of
> subsequent partitions.
>
> This change applies to partitions found by fs/partitions/check.c
> and to partitions explicitly created via an ioctl.
>
> There is no uniform agreement on whether partitions that extend
> beyond the end of the device should be clipped or discarded.
> Discarding is safer as it makes corruption less likely.
> Clipping is more flexable and gives continued access to the partition.
> So provide a kernel-parameter which a 'safe' default.
>
> partitions=strict
> is the default
> partitions=relaxed
> means that partitions are clipped rather than rejected.
> This kernel parameters only applies to auto-detected partitions,
> not those set by ioctl.
>
>
> Signed-off-by: Neil Brown <neilb@suse.de>
>
> ### Diffstat output
> ./Documentation/kernel-parameters.txt | 8 ++++++++
> ./block/ioctl.c | 6 ++++++
> ./fs/partitions/check.c | 28 ++++++++++++++++++++++++++--
> 3 files changed, 40 insertions(+), 2 deletions(-)
>
> diff .prev/Documentation/kernel-parameters.txt ./Documentation/kernel-parameters.txt
> --- .prev/Documentation/kernel-parameters.txt 2006-10-16 10:03:40.000000000 +1000
> +++ ./Documentation/kernel-parameters.txt 2006-10-16 10:06:42.000000000 +1000
> @@ -1148,6 +1148,14 @@ and is between 256 and 4096 characters.
> Currently this function knows 686a and 8231 chips.
> Format: [spp|ps2|epp|ecp|ecpepp]
>
> + partitions= How to interpret partition information that
> + could be corrupt.
> + 'strict' is the default. Partitions that
> + don't fit in the device are rejected.
> + 'relaxed' is an option. Partitions that start
> + within the device be end beyond the end are
s/be/but/ ??
> + clipped.
> +
---
~Randy
next prev parent reply other threads:[~2006-10-16 1:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 23:50 Why aren't partitions limited to fit within the device? Neil Brown
2006-10-13 1:02 ` Andries Brouwer
2006-10-13 1:31 ` Neil Brown
2006-10-13 15:07 ` Alan Cox
2006-10-13 18:16 ` jdow
2006-10-16 0:08 ` Neil Brown
2006-10-16 1:22 ` Wakko Warner
2006-10-16 1:31 ` Randy Dunlap [this message]
2006-10-16 4:09 ` Kyle Moffett
2006-10-16 6:40 ` Andries Brouwer
2006-10-16 6:43 ` dean gaudet
2006-10-16 7:28 ` Xavier Bestel
2006-10-16 10:54 ` Alan Cox
2006-10-17 6:05 ` Chris Wedgwood
2006-10-15 8:29 ` Ville Herva
2006-10-15 23:50 ` Neil Brown
2006-10-16 5:27 ` Ville Herva
2006-10-16 6:02 ` Andries Brouwer
2006-10-16 6:20 ` Ville Herva
2006-10-16 6:27 ` dean gaudet
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=20061015183148.13f9d1da.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=aeb@cwi.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
/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