linux-mips
[Top] [All Lists]

Re: Broken readdir() since 3.5 for ext3 on mips-n32

To: linux-mips@linux-mips.org
Subject: Re: Broken readdir() since 3.5 for ext3 on mips-n32
From: Lluís Batlle i Rossell <viric@viric.name>
Date: Mon, 5 Nov 2012 22:23:06 +0100
Cc: Nikita Karetnikov <nikita.karetnikov@gmail.com>
In-reply-to: <20121105212019.GN2052@vicerveza.homeunix.net>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <20121102183828.GX2052@vicerveza.homeunix.net> <20121104232119.GF2052@vicerveza.homeunix.net> <20121105073221.GG2052@vicerveza.homeunix.net> <20121105212019.GN2052@vicerveza.homeunix.net>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Nov 05, 2012 at 10:20:19PM +0100, Lluís Batlle i Rossell wrote:
> Hello,
> 
> with the help of Lars on irc, we've tracked down the issue to a broken 
> readdir()
> in ext3 in n32, introduced in the kernel 3.5 by this commit:
> d7dab39b6e16d5eea78ed3c705d2a2d0772b4f06
> 
> That renders ext3 quite useless in mips n32.
> 
> In a kernel after that commit, the example program in the 'getdents' man page
> returns this:
> [root@fu2:~/readdir]# ./getdents 
> --------------- nread=116 ---------------
> i-node#  file type  d_reclen  d_off   d_name
>     3694  regular      20 1780583312  prova.c
>  1037850  regular      24 -985956880  getdents.c
>  1037848  directory    16 -1999547753  .
>  1037849  regular      20  222381689  getdents
>   778241  directory    16 -1849228342  ..
>     3647  regular      20         -1  prova
> 
> 
> I took Lars suggestion of applying the patch I attach (forcing ext3 to think 
> it
> is a 32-bit system), and then all works. init (upstart) doesn't deadlock 
> anymore, readdir() works fine, and the getdents info looks right:
> [root@fu2:~/readdir]# ./getdents 
> --------------- nread=116 ---------------
> i-node#  file type  d_reclen  d_off   d_name
>     3694  regular      20  334739480  prova.c
>  1037850  regular      24  473707228  getdents.c
>  1037848  directory    16  824759881  .
>  1037849  regular      20  875064456  getdents
>   778241  directory    16 1524836457  ..
>     3647  regular      20 2147483647  prova
> 
> How to solve this, I don't know. But it seems that ext3 thinks that mips-n32
> programs can eat some 64-bit words in d_off.

Now I add the patch I mentioned.
 
Regards,
Lluís.

Attachment: ext3-n32.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>