From: Miklos S. <mi...@sz...> - 2006-12-15 15:46:31
|
> > > When turning readdir_ino on, the directory filler doesn't get "correct" > > > inode numbers until the files are stat()ed a first time. This is due to > > > the fact only a lookup is done in fill_dir_common, which looks up a node > > > in the name table, but doesn nothing if the node doesn't exist, which > > > happens when files have not been stat()ed a first time (or some similar > > > operation). > > > > > > The fix consists in using find_node instead of lookup_node. Thread > > > locking being done by find_node, we can also remove it. > > > > Thanks for the patch. The problem with this apporach, that it would > > leak memory, because there's no way of knowing when the node isn't > > needed any more. > > Well, I didn't look very deeply in the code, but if you explain me, > maybe I could come up with something better ;) > I don't really see, for instance, how it differs from find_node being > called from other places of the code, and how special this occurence is > that it would leak memory... In all other places find_node() will be balanced by an nlookup count in forget_node(). This is because the kernel keeps track of how many times a node has been looked up, and when it flushes that node, these references can be released. But reading the directory doesn't create any state for the node in either the kernel or the library, so forget_node() won't be called on it. Miklos |