This is a placeholder for the upstream bug report:
"If a client interleaves readdir() and remove() calls on a mounted NFS share, upon reaching past the end of the directory entries readdir() returns the first directory entry over again, instead of NULL or whatever the signal is supposed to be. This can cause certain programs (in my case, transmission-daemon when removing&trashing a downloaded torrent) to go into an infinite-loop.
More information here (especially comments 3 and laters): https://trac.transmissionbt.com/ticket/5890
I've fixed it in my build by commenting out the following section of readdir.c:
/* ignore cookie if unexpected so we restart from the beginning */
cookie = 0;
However, I don't know if that's an appropriate fix or if there are better ways to fix this problem (because I don't know much C, and even less about the NFS protocol). Just thought you should know about this issue. And also I would like to take this opportunity to thank you for making this awesome and extremely useful program."