All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Fwd: [md@Linux.IT: LVM tools broken on PPC (and many other archs)]
@ 2000-12-17  8:17 Russell Coker
  2000-12-17 11:01 ` Claudio Matsuoka
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Coker @ 2000-12-17  8:17 UTC (permalink / raw)
  To: md; +Cc: linux-lvm

This is a general LVM driver issue, and therefore something that's more 
appropriate for the main LVM developers to deal with, as don't have access to 
non-Intel hardware and I don't have the knowledge of LVM driver internals 
that these people have it doesn't make sense for me to try and deal with this.

I am sending this message to the LVM mailing list, hopefully someone there 
can resolve this issue.

----------  Forwarded Message  ----------
Subject: [md@Linux.IT: LVM tools broken on PPC (and many other archs)]
Date: Sun, 17 Dec 2000 01:39:48 +0100
From: Marco d'Itri <md@Linux.IT>
To: russell@coker.com.au


Please add this fix to your LVM package, it's needed on most
architectures.

--
ciao,
Marco
Date: Fri, 15 Dec 2000 18:07:27 +0100
From: Marco d'Itri <md@Linux.IT>
To: linux-lvm-patch@ez-darmstadt.telekom.de
Cc: andrea@suse.de
Subject: LVM tools broken on PPC (and many other archs)
Message-ID: <20001215180727.A1985@wonderland.linux.it>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.12i

pv_get_size() tries parsing the MBR, but that fails on PPC because of
the different endianess from what the function expects.

The result is that the tools think the partition is as big as the whole
disk, and everything seems to work until you put enough data in the
file system and some of the non existent blocks are used (the kernel
will complain and return EIO, but at least it does not explode).

From the changelog I see Andrea Arcangeli contributed a very crude
workaround for the alpha platform, which has the same endianess of i386
but (I suppose) a different disk label format.
The same "fix" works for PPC too (and sparc, and so on), so I think the
#ifndef __alpha__ at the beginning of lib/pv_get_size.c should really be
#ifdef __i386__ until some better code is written (FYI, you can find
byte swapping code within fdisk).

The fix needs to be fixed too, because other code will expect something
in the buffer pointed by the second argument. I just added that at the
end of the function:

        if (dummy)
                memset(dummy, 0, sizeof (struct partition));

With this fix, everything seems to work fine.

--
ciao,
Marco

-------------------------------------------------------

-- 
http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] Fwd: [md@Linux.IT: LVM tools broken on PPC (and many other archs)]
  2000-12-17  8:17 [linux-lvm] Fwd: [md@Linux.IT: LVM tools broken on PPC (and many other archs)] Russell Coker
@ 2000-12-17 11:01 ` Claudio Matsuoka
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Matsuoka @ 2000-12-17 11:01 UTC (permalink / raw)
  To: linux-lvm; +Cc: md

On Sun, 17 Dec 2000, Russell Coker wrote:

> This is a general LVM driver issue, and therefore something that's more 
> appropriate for the main LVM developers to deal with, as don't have access to 
> non-Intel hardware and I don't have the knowledge of LVM driver internals 
> that these people have it doesn't make sense for me to try and deal with this.

I have access to a PPC box (an iMac DV running Debian), so I can test the
changes eventually done to the code. I can't promise a fix myself since
I'm no PPC expert, and no LVM expert either.


> Date: Fri, 15 Dec 2000 18:07:27 +0100
> From: Marco d'Itri <md@Linux.IT>
> 
> pv_get_size() tries parsing the MBR, but that fails on PPC because of
> the different endianess from what the function expects.
> 
> From the changelog I see Andrea Arcangeli contributed a very crude
> workaround for the alpha platform, which has the same endianess of i386
> but (I suppose) a different disk label format.
> The same "fix" works for PPC too (and sparc, and so on), so I think the
> #ifndef __alpha__ at the beginning of lib/pv_get_size.c should really be
> #ifdef __i386__ until some better code is written (FYI, you can find
> byte swapping code within fdisk).
> 
> The fix needs to be fixed too, because other code will expect something
> in the buffer pointed by the second argument. I just added that at the
> end of the function:
> 
>         if (dummy)
>                 memset(dummy, 0, sizeof (struct partition));
> 
> With this fix, everything seems to work fine.

I'll have a look.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-12-17 11:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-17  8:17 [linux-lvm] Fwd: [md@Linux.IT: LVM tools broken on PPC (and many other archs)] Russell Coker
2000-12-17 11:01 ` Claudio Matsuoka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.