Bug #1691
openzfs diff hardlinks problem
0%
Description
problem: creating hardlinks on newly created files (after snapshot) "confuses" zdiff. either the new file OR the hardlink will be shown as created...
zfs snapshot some/pool@hardlink-test
echo "hello hardlink" > /some/pool/newfile
ln newfile hardlink
zfs diff some/pool@hardlink-test some/pool
output:
M /some/pool/
+ /some/pool/hardlink
it can also show up ONLY /some/pool/newfile . but it will NEVER show both (as what I would define the correct expected behaviour...).
Updated by sham pavman almost 12 years ago
- Assignee set to sham pavman
Yes , this is a problem .. I recreated this and feel this needs to be fixes as well..
I'm taking it up..
Shampavman
Updated by Rich Lowe almost 12 years ago
You know, this isn't so unexpected.
There are exactly 3 new things:
- One new file (inode)
- One new directory entry for that new file
- One new directory entry for the hardlink to that new file
The latter two are both modifications to the directory, so showing the directory as modified and the file added (with whichever name is most convenient, since they're equivalent) seems totally reasonable.
Updated by sham pavman almost 12 years ago
Yes I did think on these lines and yes what you said is right..
However I felt that if whatever is convenient is taken up then there is a very high chance of further introspection being needed to figure out how/from where an extra file came up(when it was not listed in the diff).
It might be a hardlink but still that addition when added to the hierarchy needs to be listed, right?
Furthermore this ambiguity only increases as the hierarchy of the FS starts building up.
Don't you think so? or am i missing something.
Updated by Michael Keller over 11 years ago
I find the current behaviour plain wrong because the user thinks that zdiff shows paths but in reality it shows paths of inodes .
thats a big difference because every other tool on earth works with paths and such a behaviour will break them or need additional logic to get them working with zdiff output.
Updated by Albert Lee over 8 years ago
Michael Keller wrote:
I find the current behaviour plain wrong because the user thinks that zdiff shows paths but in reality it shows paths of inodes .
thats a big difference because every other tool on earth works with paths and such a behaviour will break them or need additional logic to get them working with zdiff output.
zfs diff does report renames and changes to directory entries, so it seems inconsistent to be missing directory entry creation and deletion reporting separate from file object creation.