fuse-ext2 assigns distinct node ids for multiply linked files' various names
Closed this issue · 1 comments
It is vitally important that every name of a multiply-linked file have the same node (basically an inode, in FUSE-parlance). But fuse-ext2 assigns different node ids to each name of a multiply-linked file. The files do behave as if they're hardlinked; writing to one causes the other's data to change, too. However, using different node ids screws up the kernel's attribute cache.
Here's an example of the problem. These commands create one file and then hardlink it twice. As you can see, each name has a different inode. But also notice what happens to the nlink value. At first foo has a (wrong) nlink value of 2. But after the one second sleep foo has the correct nlink value of 3. That's because the attr cache expired during that one second.
# touch foo && ln foo bar && ln bar baz && ls -li && sleep 1 && ls -li
total 32
190 -rw-r--r-- 3 root wheel 0 May 8 11:44 bar
190 -rw-r--r-- 3 root wheel 0 May 8 11:44 baz
189 -rw-r--r-- 2 root wheel 0 May 8 11:44 foo
166 drwx------ 2 root wheel 16384 May 3 15:39 lost+found
total 32
189 -rw-r--r-- 3 root wheel 0 May 8 11:44 bar
190 -rw-r--r-- 3 root wheel 0 May 8 11:44 baz
188 -rw-r--r-- 3 root wheel 0 May 8 11:44 foo
166 drwx------ 2 root wheel 16384 May 3 15:39 lost+found
Using the -o use_ino
option does not solve the problem. It just hides it. With that option, multiply-linked files inodes' are indeed identical. However, their FUSE node id's aren't affected. It's allowed for the inode and the node id to differ.
This turns out to be an upstream bug.
libfuse/libfuse#412