help-hurd
[Top][All Lists]
Advanced

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

Re: "find" doesn't work


From: Ludovic Courtès
Subject: Re: "find" doesn't work
Date: Fri, 14 Jun 2002 18:30:35 +0200

Hi,

I found the reason why find doesn't work. Beside setting st_nlink to the
number of subdirs plus two as Thomas said, it is also necessary to set a
different inode number (st_ino) for each node of the fs. Otherwise find will
just skip the subdirs that have an already seen inode number.  The version of
shadowfs I have just doesn't set the st_ino field, so it may or may not work.

This means that find may also not work well when searching across various
filesystems since different filesystems may very well use the same inode
numbers.

Cheers,
Ludovic.

On Mon, Jun 10, 2002 at 05:48:28PM -0700, Thomas Bushnell, BSG wrote:
> Wolfgang Jährling <wolfgang@pro-linux.de> writes:
> 
> > Moritz told me that find uses an optimization that causes it to ignore
> > some directories in Shadowfs: The "struct stat" for a directory contains
> > the number of links to the directory, which also tells us the number of
> > subdirectories, as we have a ".." link from each subdir plus two other
> > links ("." and the link to it in its parent directory).  Thus, if find
> > has processed st_nlink-2 subdirs, it assumes there are no more.  And
> > Shadowfs simply returned the struct stat for one of its underlying
> > directories.  
> 
> This is a real bug in shadowfs.
> 
> Hurd directory servers are required to provide the correct st_nlink
> value, which is always the number of subdirs, plus two.
> 
> 



reply via email to

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