[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong logical sector size detection

From: Benjamin Cama
Subject: Re: Wrong logical sector size detection
Date: Mon, 10 Apr 2006 16:42:29 +0200

Sorry for the long delay, i'm having difficulties with my system (lack
of free space, the reason i try to use parted), the mail system at work
(no smtp available), etc ...

Le samedi 08 avril 2006 à 19:52 +0200, address@hidden a écrit :
> On Thu, Apr 06, 2006 at 06:07:30PM +0200, Benjamin Cama wrote:
> > >   The bugs with the ioctl and the printf are of course genuine. The
> > > fix for them will go into rc4, which I will probably release today.
> >
> > Great.
> Did you already have the chance to test this?

Yes, did it this week-end and it works great ! Not so great when trying
to resize my HFS+ partition, but the problem with the sector size is

> > The reason for this bug not appearing earlier may be that this version
> > has been quite untested...
> To be exact, I wondered why this bug didn't show up on i386.

Well, i found it out : the BLKSSZGET ioctl() must be given a pointer to
a 32 bits integer. So the way parted did it since the "long long" change
was broken. It worked though on little-endian architectures because the
LSB is written first, so even when the ioctl only wrote the first 32
bits of the (64 bits) variable, it worked. On big-endian, the LSB is
last, so when the ioctl wrote the first 32 bits in this long long, it
(the least significant byte) ended lying in the "middle" of the 64 bits
integer. And so did i get the unreasonable sector size (and the %d in
the printf didn't help me either).

I looked at your fix, and i think it is the good solution (pass the
ioctl() an int and then cast it to a long long).

> > [after being quite sceptical and having tested it on an Intel P4 with
> > a 2.6.8 kernel (on a debian testing)] : In fact it works well on a 32b
> > Intel ..?!? I think i should investigate this further, i don't see why
> > the PPC version is screwed up.
> I'd be interested to know why this worked on i386.
>   Cheers!
>     Leslie


reply via email to

[Prev in Thread] Current Thread [Next in Thread]