[bug #59766] printf %i doesn't show same result in all situations
Tavian Barnes <[email protected]>
| Newsgroups | gmane.comp.gnu.findutils.bugs |
|---|---|
| Message-ID | <[email protected]> |
Follow-up Comment #2, bug #59766 (project findutils):
I've noticed this before too: https://savannah.gnu.org/bugs/?54913#comment5
The problem is, d_type and d_ino will be wrong for bind mounts. This is a
known bug (even a POSIX violation for d_ino), but with little interest in
fixing it from the kernel side:
https://www.spinics.net/lists/linux-fsdevel/msg139630.html
It's expensive to stat() every file, so a workaround would be preferable. In
bfs I only stat() files whose name matches a mount point (discovered by
reading /proc/self/mounts), although bfs never trusts d_ino:
https://github.com/tavianator/bfs/blob/038579b8fd9b96a207cb45e0adf113e881d8ff8d/bftw.c#L961-L971
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59766>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/