Closed phprus closed 3 years ago
Btrfs is are default file system on SUSE 12+ and Fedora 33+.
Possible workaround:
Replace CHECK(fs::hard_link_count(t.path()) == 2)
to CHECK(fs::hard_link_count(t.path()) == 2 || fs::hard_link_count(t.path()) == 1);
and
CHECK(fs::hard_link_count(t.path()) == 3)
to CHECK(fs::hard_link_count(t.path()) == 3 || fs::hard_link_count(t.path()) == 1);
Nice find. Ich think I prefer to use an lstat
helper in filesystem_test for Linux to compare to its result, to keep the test from accepting 1 when the fs is not BTRFS. I'll look into it later today after work.
Describe the bug hard_link_count test logic is wrong on BTRFS. The links counter is always equal to 1 (https://unix.stackexchange.com/a/618726).
Error:
To Reproduce Run test on BTRFS.