public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philippe De Muyter <phdm@macqel.be>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Karel Zak <kzak@redhat.com>,
	Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH 3/5] partitions/msdos: enumerate also AIX LVM partitions
Date: Tue, 21 May 2013 09:16:04 +0200	[thread overview]
Message-ID: <20130521071604.GA19266@frolo.macqel> (raw)
In-Reply-To: <20130520164152.9148828cc29fab3d3d02be23@linux-foundation.org>

Hi Andrew,

On Mon, May 20, 2013 at 04:41:52PM -0700, Andrew Morton wrote:
> On Mon, 29 Apr 2013 23:18:31 +0200 Philippe De Muyter <phdm@macqel.be> wrote:
> 
> > Graft AIX partitions enumeration in partitions/msdos.c
> > 
> > There is already a AIX disks detection logic in msdos.c.  When an
> > AIX disk has been found, and if configured to, call the aix partitions
> > recognizer.  This avoids removal of AIX disks protection from msdos.c,
> > avoids code duplication, and ensures that AIX partitions enumeration
> > is called before plain msdos partitions enumeration.
> > 
> > ...
> >
> > --- a/block/partitions/msdos.c
> > +++ b/block/partitions/msdos.c
> > @@ -23,6 +23,7 @@
> >  #include "check.h"
> >  #include "msdos.h"
> >  #include "efi.h"
> > +#include "aix.h"
> >  
> >  /*
> >   * Many architectures don't like unaligned accesses, while
> > @@ -462,8 +463,12 @@ int msdos_partition(struct parsed_partitions *state)
> >  	 */
> >  	if (aix_magic_present(state, data)) {
> >  		put_dev_sector(sect);
> > +#ifdef CONFIG_AIX_PARTITION
> > +		return aix_partition(state);
> > +#else
> >  		strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
> >  		return 0;
> > +#endif
> >  	}
> >  
> >  	if (!msdos_magic_present(data + 510)) {
> 
> hm, what's going on here.
> 
> Why does partitions/msdos.c know about AIX at all?  Is there something
> special about AIX partitioning which ties it in with msdos?

Well, PowerPC BIOS (PPCBUG or Open Firmware) mimics PC BIOS and requires the
first block of the disk to describe the boot partition the same way that
PC BIOS does.  Remember, the aim of IBM, Motorola and Apple was to replace
the PC's by PowerPC's :).  So, an AIX disk can erroneously be recognized as
a dos disk with two partitions (two times the same boot partition).  That's
the reason why there is already code in block/partitions/msdos.c to avoid
that.
> 
> Now that we have AIX partitioning support, can we simply remove the AIX
> code from msdos.c?  So msdos.c will say "I don't know what that is",
> and we fall through to aix.c which says "that's mine!"?

I didn't want to remove the AIX protection from msdos.c, for the likely case
that someone would compile the kernel without AIX_PARTITION support,  And, as
a part of the AIX detection was already done by 'aix_magic_present', I did
not want to duplicate it.  I can move the AIX detection logic to aix.c and
still keep the AIX protection for msdos.c with some more #ifdef's if you prefer.

Philippe

  reply	other threads:[~2013-05-21  7:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29 21:18 [PATCH v2 0/5] partitions: add AIX LVM support Philippe De Muyter
2013-04-29 21:18 ` [PATCH 1/5] partitions/msdos.c: end-of-line whitespace and semicolon cleanup Philippe De Muyter
2013-04-29 21:18 ` [PATCH 2/5] Add aix lvm partitions support files Philippe De Muyter
2013-05-20 23:39   ` Andrew Morton
2013-05-21  7:27     ` Philippe De Muyter
2013-05-24 10:04       ` Christoph Hellwig
2013-05-24 10:58         ` Philippe De Muyter
2013-08-12 11:52           ` Christoph Hellwig
2013-08-12 12:21             ` Alasdair G Kergon
2013-04-29 21:18 ` [PATCH 3/5] partitions/msdos: enumerate also AIX LVM partitions Philippe De Muyter
2013-05-20 23:41   ` Andrew Morton
2013-05-21  7:16     ` Philippe De Muyter [this message]
2013-04-29 21:18 ` [PATCH 4/5] partitions/Makefile: compile aix.c if configured Philippe De Muyter
2013-04-29 21:18 ` [PATCH 5/5] partitions/Kconfig: add the AIX_PARTITION entry Philippe De Muyter
  -- strict thread matches above, loose matches on Subject: below --
2013-05-01  6:09 [PATCH v3 0/5] partitions: Add aix lvm partitions support Philippe De Muyter
2013-05-01  6:09 ` [PATCH 3/5] partitions/msdos: enumerate also AIX LVM partitions Philippe De Muyter
2013-04-25 21:10 [RFC PATCH 0/5] Add aix lvm partitions support Philippe De Muyter
2013-04-25 21:10 ` [PATCH 3/5] partitions/msdos: enumerate also AIX LVM partitions Philippe De Muyter

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=20130521071604.GA19266@frolo.macqel \
    --to=phdm@macqel.be \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=kzak@redhat.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