Based on our experiments, and observed behavior of Digital Unix clients we now believe that this problem is due to a client bug. More specifically, this appears to be caused by a client illegally using the (supposedly opaque) 'cookie' that the filer sends as part of a 'readdir' response to determine if the directory has grown.
In this case, because the 'cookie' in the response to its first 'readdir' request matches its cached copy, the client appears to incorrectly conclude that the directory hasn't grown, and so does not send any futher 'readdir' requests. The client also ignores the fact that end-of-file is not set in the response.
We were also able to modify the test case so that it misbahaves even when run against a Solaris 2.5.1 NFS server.
The reason why this problem would occur much more commonly with a NetApp filer is related to the way directory compaction is done on the filer as compared to the Solaris server, and also the amount of directory data returned in a 'readdir' response.
The modified test script follows.
--------------------------- #!/usr/ucb/csh
# create a log of datafiles and links to test nfs problem
set num = 0 while ( $num < 16 ) @ num = $num + 1 cat /etc/zoneinfo > rereallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongnamedatafile.$num echo "$num is done" end
ls | wc ls | wc
set num = 32 while ( $num < 64 ) @ num = $num + 1 cat /etc/zoneinfo > reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongnamedatafile.$num echo "$num is done" end
ls | wc
echo done
exit ---------------------------
Rajesh Sundaram
We are investigating this issue internally. We have reproduced it. Our intial investigations show that the Digital Unix client sends a readdir request and we respond to it. We mark in our reply that we are not at the end of the directory, but the client never comes back for more. Our suspicions are that the client is deciding it has all of the directory information based on some client side cached information or the cookie we pass back. We have not yet determined with certainty whether it is a client or server bug.
John Edwards Member of Technical Staff Network Appliance