Eric Blake wrote:
> According to Jim Meyering on 9/7/2009 3:09 AM:
>>   ls -i now prints consistent inode numbers also for mount points.
>>   This makes ls -i DIR less efficient on systems with dysfunctional readdir,
>>   because ls must stat every file in order to obtain a guaranteed-valid
>>   inode number.  [bug introduced in coreutils-6.0]
>
> On systems with working d_type, is it sufficient to limit the stat() to
> situations where we know that the entry might be a directory (DT_DIR or
> DT_UNKNOWN)?  In other words, are we guaranteed that mount points can only
> occur atop directories, and that we can avoid the stat() for regular files?

Recently I saw a note in which someone mentioned bind mounts on
non-directories, so at least in general, that may not be sufficient.
However, I don't have the reference handy and can't dig right now.


Reply via email to