This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: d_off field in struct dirent and 32-on-64 emulation
- From: Mao Han <han_mao at c-sky dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 7 Jan 2019 10:05:35 +0800
- Subject: Re: d_off field in struct dirent and 32-on-64 emulation
- References: <87bm56vqg4.fsf@mid.deneb.enyo.de> <957967d7-5717-8ada-fb30-dfdf19898b6b@linaro.org> <87pntmu9iw.fsf@mid.deneb.enyo.de> <ae0530c9-5c46-5560-9734-1eacaf173b8d@linaro.org> <alpine.DEB.2.21.1812311657050.27287@digraph.polyomino.org.uk> <a5092631-2ddf-1790-5f27-777646ef3d34@linaro.org> <20190104023213.GA27571@vmh-VirtualBox> <87va34srpj.fsf@oldenburg2.str.redhat.com> <0947d0c7-4c85-8acf-78c9-c3c1b720d1ad@linaro.org>
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