This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sparc 32-bit dirent broken


On Thu, Oct 10, 2013 at 05:17:16PM -0400, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Thu, 10 Oct 2013 17:06:28 -0400 (EDT)
> 
> > I'll test out this theory.
> 
> Indeed, the following patch fixes the bug.  We were just being lucky
> beforehand in that the off_t was 64-bit and therefore making the
> data[] array be 64-bit aligned as well.  Once you add the errcode
> there it is only 4-byte aligned.
> 
> On powerpc/x86-32 there are no alignment traps, so you wouldn't notice
> this problem on those platforms.
> 
> The critical element is whatever alignment d_off/d_ino need, that can
> be either __off_t/__ino_t or __off64_t/__ino64_t.
> 
> Any suggestions for a better alignof or is this good enough to fix
> the problem?  We probably should have a per-sysdep definition of
> "largest C type alignment" so we can use it in situations like this.
>
Is adding largest C type alignment  worth hassle? For io structures a buffer
cause much bigger footprint that few bytes possibly wasted due of alignment. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]