I posted an article about this in the comp.unix.solaris newsgroup back in early December, but I didn't get any response. Maybe I will have more luck here.
A patch 118463-01 was released by Sun for Solaris 9 du(1) on 2004-12-06. It "fixes"
5068958 Solaris 9 du exits with "cycle detected"
The description of this on SunSolve includes the following:
| Description: | | Solaris 9 du exits with: | | du: failed for /: Cycle detected from XXX to XXX | | when a hardlink in the filesystem is detected. While at first sight this seems | reasonable behaviour due to the potentially harmful nature of hardlinked | directories, there is a genuine need to handle this in a more graceful way. | | One such example comes from using a NetApp File Server with snapshots. | The NetApp server exports snapshot heirarchies with file ids (aka inode | numbers) which appear to be identical to existing directory file ids. | | While this is an implementation issue concerning the interaction between | Sun's NFS clients and NetApp File Servers, in the interests of interoperability, | the Solaris 9 du should simply ignore directories with apparent duplicate | inode numbers.
I wonder what other users of Solaris in conjunction with NetApp filers think of this? Personally I thought the change in Solaris 9 was positively beneficial ... an error (even if obscurely expressed from the end-user's point of view) rather than a totally misleading result.
It might have been useful if the patch had been to produce warning messages "I've seen this directory inode number before, I'm leaving this [snapshot] out of the space calculation altogether" and carry on with the rest of the tree. (One might think that this was what was implied by "simply ignore directories with apparent duplicate | inode numbers".) But it seems that it actually restores the Solaris 8-and-earlier behaviour, in which you get a total which is a naive sum over all snapshots, which is never (well, hardly ever) meaningful.
Chris Thompson Email: cet1@cam.ac.uk