Re: [RFC v1] man/man3/readdir.3, man/man3type/stat.3type: Improve documentation about .d_ino and .st_ino

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

 



At 2025-05-28T23:31:29+0200, Alejandro Colomar wrote:
[snip]
> diff --git a/man/man3/readdir.3 b/man/man3/readdir.3
[snip]
> +If the directory entry is the mount point,
> +then
> +.I .d_ino
> +differs from
> +.IR .st_ino :
> +.I .d_ino
> +is the inode number of the underlying mount point,
> +while
> +.I .st_ino
> +is the inode number of the mounted file system.
> +According to POSIX,
> +this Linux behavior is considered to be a bug,
> +but is nevertheless conforming.
>  .TP
>  .I .d_off
>  The value returned in

Can someone add a *roff comment supporting the claim in the second
sentence?  For example, could we have a citation to an Austin Group
mailing list post or a ticket in the group's Mantis bug tracker?

I've followed the Austin Group mailing list for years and, to me, it
sounds uncharacteristic of the POSIX developers to decree an
implementation as "conforming but buggy".

I've checked Draft 4 (the final draft) of the 2024 standard, and see
nothing to support this claim in its dirent.h or readdir() pages.
Typically, if an implementation is "getting away with" something that
the Austin Group finds objectionable, they anticipate and give notice of
a potential change in semantics or of a planned interface removal in the
"Future Directions" sections of their entries.

It's possible I overlooked something.  I used text search rather than
reading all 4,101 pages of the standard at a sitting.  (I count only 9
total matches for `d_ino`; all are in the aforementioned 2 entries, or
[new to Issue 8] posix_getdents().)

There may be something analogous to the mount point situation in the
case of symbolic links, which the standard _does_ contemplate:

"The value of the [dirent] structure's _d_ino_ member shall be set to
the file serial number of the file named by the _d_name_ member.  If the
_d_name_ member names a symbolic link, the value of the _d_ino_ member
shall be set to the file serial number of the symbolic link itself."
(p. 1858, lines 61297-61299)

...which leads me to wonder what an implementation--Linux,
specifically--decides the right thing is when one readdir()s a symbolic
link to a mount point.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux