[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #59766] printf %i doesn't show same result in all situations
From: |
Tavian Barnes |
Subject: |
[bug #59766] printf %i doesn't show same result in all situations |
Date: |
Sat, 26 Dec 2020 15:30:18 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0 |
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/