fuse/test-fuse.c: Partially disable test because of caching

Previously we noted in a comment that stat("hello.txt") is cached (and
not called again), so the test of the link count failed.  Something
has changed, possibly in the kernel, but it results in even more
aggressive caching so that an earlier, similar test also fails in the
same way.  I checked by enabling debugging that the stat call doesn't
result in guestfs_lstatns being called, and the old value for the
statbuf was being returned.

(cherry picked from commit f16fcdcfa2)
This commit is contained in:
Richard W.M. Jones
2022-07-01 15:12:23 +01:00
parent 99c4157556
commit 5cc914bccc

View File

@@ -418,6 +418,14 @@ test_fuse (void)
return -1;
}
#if 0
/* This fails because of caching. The problem is that the linked file
* ("hello.txt") is cached with a link count of 1. unlink("link")
* invalidates the cache for "link", but _not_ for "hello.txt" which
* still has the now-incorrect cached value. However there's not much
* we can do about this since searching for all linked inodes of a file
* is an O(n) operation.
*/
if (stat ("hello.txt", &statbuf) == -1) {
perror ("stat: hello.txt");
return -1;
@@ -433,14 +441,6 @@ test_fuse (void)
return -1;
}
#if 0
/* This fails because of caching. The problem is that the linked file
* ("hello.txt") is cached with a link count of 2. unlink("link")
* invalidates the cache for "link", but _not_ for "hello.txt" which
* still has the now-incorrect cached value. However there's not much
* we can do about this since searching for all linked inodes of a file
* is an O(n) operation.
*/
if (stat ("hello.txt", &statbuf) == -1) {
perror ("stat: hello.txt");
return -1;