RHEL7.2: For a few simlinks on an xfs filesystem, getdents() is returning d_type = DT_REG, indicating a regular file, which differs from stat() return of st_mode = S_IFLNK, indicating a link
Issue
The following 'find' command should be showing files only but shows some symlinks
# find /usr/bin -mount -perm -0002 -type f -exec ls -l {} \;
lrwxrwxrwx 1 root root 4 Apr 10 16:04 /usr/bin/ping6 -> ping
...
We have noticed this in the /usr/bin and /usr/share/man/man? directories It is repeatable but only a few servers and only a few files out of thousands
strace analysis shows that these show up as DT_REG and not DT_LNK
d_ino=113834, d_off=2025, d_reclen=32, d_name="ping6", d_type=DT_REG} <<
Environment
- Red Hat Enterprise Linux 7
- kernels before kernel-3.10.0-354.el7
- xfs
- symlinks
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.