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: d_off field in struct dirent and 32-on-64 emulation


On Fri, Jan 04, 2019 at 09:03:14AM -0200, Adhemerval Zanella wrote:
> 
> On 04/01/2019 07:22, Florian Weimer wrote:
> > * Mao Han:
> > 
> >> I'm still not clear what's the problem of using getdent64 on csky, seems
> >> getdent64 may fail when LFS is used. I haven't seen any our customer use
> >> LFS before, so no one will be affected by this issue at present?
> > 
> > Could you post “strace -v” output from something calling getdents64 on
> > an ext4 file system, please?
> > 
> > It may be that the problem does not exist because ext4 always uses
> > 31-bit hashes for d_off on csky.
> > 
> > Thanks,
> > Florian
> > 
> 
> My understanding is ext4 on csky will set 32bit API since it does not
> need to support compat mode:
> 

I haven't add support for strace yet, so print the getdents64 call with gdb.
Seems to match the explanation.

Breakpoint 2, ksys_getdents64 (fd=3, dirent=0xc41dc, count=32768)
    at fs/readdir.c:300
300		struct getdents_callback64 buf = {
2: /x *dirent = {d_ino = 0x1001, d_off = 0x28866417, d_reclen = 0x18, 
  d_type = 0x4, d_name = 0xc41ef}
(cskygdb) 
Continuing.

Breakpoint 2, ksys_getdents64 (fd=3, dirent=0xc41dc, count=32768)
    at fs/readdir.c:300
300		struct getdents_callback64 buf = {
2: /x *dirent = {d_ino = 0x0, d_off = 0x0, d_reclen = 0x0, d_type = 0x0, 
  d_name = 0xc41ef}
(cskygdb) c
Continuing.

Breakpoint 2, ksys_getdents64 (fd=3, dirent=0xc41dc, count=32768)
    at fs/readdir.c:300
300		struct getdents_callback64 buf = {
2: /x *dirent = {d_ino = 0x2, d_off = 0xc203a91, d_reclen = 0x18, 
  d_type = 0x4, d_name = 0xc41ef}
(cskygdb) 
Continuing.

Thanks
Mao Han


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