main: introduce inodes cache

introduce a hash map to refer from an inode to the file paths.
A recent change where we enable FUSE writeback by default uncovered an
underlying issue in fuse-overlayfs where changes to a file with
multiple links would not be visible from the other link.

For each inode, maintain a list of nodes that refer to it, so that we
can still access it when a link is removed and more importantly we can
use the inode value with FUSE.

Closes: https://github.com/containers/fuse-overlayfs/issues/108
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1744109

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-08-22 23:16:36 +02:00
parent f8ba9ade20
commit b25bbde64d
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
2 changed files with 420 additions and 243 deletions

654
main.c

File diff suppressed because it is too large Load Diff

View File

@ -10,4 +10,13 @@ unlink merged/a
test \! -e merged/a
echo hello > merged/foo
ln merged/foo merged/foo2
rm merged/foo
grep hello merged/foo2
ln merged/foo2 merged/foo
echo world >> merged/foo2
grep hello merged/foo
grep world merged/foo
umount merged