[OpenAFS] Linux client and find command in AFS

Jeffrey Hutzelman jhutz@cmu.edu
Tue, 05 Apr 2005 15:24:29 -0400

On Tuesday, April 05, 2005 15:03:30 -0400 Rodney M Dyer <rmdyer@uncc.edu> 

> At 01:49 PM 4/5/2005, Derrick J Brashear wrote:
>> use the -noleaf option to find. it's not an afs bug, so you found no bug.
> Actually, why isn't this a bug?  He doesn't need the -noleaf option if
> there is at least one other "real" directory in the root of the directory
> he is testing.

What -noleaf does is disable a GNU find optimization in which find looks at 
the link count of a directory, and then only stats things to see whether 
they are directories until it has found the number of directories it 
expects.  AFS mount points are not counted in the link count of the 
directory containing them, so find gets confused and thinks there are fewer 
directories than there really are.

This optimization depends on a property of the unix filesystem which does 
not always apply on other filesystems.  If there's a bug, it's that GNU 
find uses this optimization without knowing for certain that it will work 
on the filesystem in use.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA