As it descends the directory tree it opens each directory and as it reads the entries recursively opens each one thats a directory. So as it opens each child directory, each parent directory is still open since it hasn't finished reading the entries in it yet. So if you get a loop in the filesystem it will simply run out of FDs.