Suppose we have the following operations:
1. rename /dir1/foo/bar to /dir2/bar2
2. rename /dir1/foo to /dir2/bar2/foo2
I.e., we rename a directory (foo) to a child of its prior descendant (bar). If we have taken snapshots on root before the above 2 rename operations, a circle can be generated consisting of nodes with the types INodeReference.WithName and INodeReference.DstReference:
WithName (foo) --> WithCount (for foo) --> foo2 --> WithName (bar) --> WithCount (for bar) --> bar2 --> DstReference (foo) --> WithCount (for foo)
When deleting a snapshot before the rename operations, the current code may hit an infinite loop when cleaning the snapshot data or updating the quota usage for the nodes in the above circle. This jira will fix the issue.