[OpenAFS] Linux client and find command in AFS

Todd M. Lewis Todd_Lewis@unc.edu
Tue, 05 Apr 2005 15:19:33 -0400


Rodney M Dyer wrote:
> 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.

Because that just masks the problem; it didn't make it go away.

The real problem is that 'find' assumes there is a . and .. entry in 
every directory, so for a directory with n directory entries, 'find' 
only recurses through n-2 entries because somebody thought the miniscule 
efficiency of actually checking if the directories it was skipping were 
. and .. would outweigh the hours upon hours of time lost by newbies to 
this problem.  When 'find' encounters a directory where there aren't . 
or .. entries (like the root of afs volumes), it does the wrong thing. 
It would fail on any filesystem that didn't have those entries because 
it assumes something that isn't true.  The '-noleaf' hack glosses over 
the problem rather than fixes it.
-- 
     +--------------------------------------------------------------+
    / Todd_Lewis@unc.edu  919-962-5273  http://www.unc.edu/~utoddl /
   /    I used to be a lumberjack, but I just couldn't hack it,   /
  /                   so they gave me the axe.                   /
+--------------------------------------------------------------+