bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug#369822: ls -i stats unnecessarily


From: Ian Jackson
Subject: Re: Bug#369822: ls -i stats unnecessarily
Date: Fri, 2 Jun 2006 16:44:49 +0100

Jim Meyering writes ("Re: Bug#369822: ls -i stats unnecessarily"):
> So at least Solaris 8 and some glibc are affected.

Err, what's glibc got to do with it ?  This behaviour is expected: if
you readdir the directory containing a mountpoint, you get the inode
number of the directory in the underlying filesystem; if you then stat
the mountpoint, you get the inode number of the root of the
filesystem mounted on top.

There are I think two approaches to this problem:
 * find a list of mountpoints in some system-specific way
   for each one stat mountpoint/..
   compare device and inode with those of the directory we're readdir'ing
 * provide an option to allow the user to specify that they don't
   mind the inode numbers of mountpoints being wrong

The 2nd is easier and certainly less fragile, and since this no-stat
optimisation is only necessary in some specialised applications (of
which I happen to have an application where it's absolutely essential
because statting each file takes far far too long), it's not that
unreasonable to demand a special option.

> unless I find a better approach, I'll turn off this optimization
> by default, and add an option to turn it back on.

Right.

Ian.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]