mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix inotify_test_native on Buildkite.
PiperOrigin-RevId: 605496604
This commit is contained in:
@@ -1871,11 +1871,26 @@ TEST(Inotify, SpliceOnWatchTarget) {
|
||||
EXPECT_THAT(splice(pipefds[0], nullptr, fd.get(), nullptr, 1, /*flags=*/0),
|
||||
SyscallSucceedsWithValue(1));
|
||||
|
||||
// On Linux, between 983652c69199 ("splice: report related fsnotify events")
|
||||
// and d53471ba6f7a ("splice: remove permission hook from
|
||||
// iter_file_splice_write()"), splice(2) generates two modification events in
|
||||
// many cases, by calling fsnotify_modify() in both fs/splice.c:do_splice()
|
||||
// and fs/splice.c:iter_file_splice_write() =>
|
||||
// fs/read_write.c:vfs_iter_write() => do_iter_write().
|
||||
events = ASSERT_NO_ERRNO_AND_VALUE(DrainEvents(inotify_fd.get()));
|
||||
ASSERT_THAT(events, Are({
|
||||
Event(IN_MODIFY, dir_wd, Basename(file.path())),
|
||||
Event(IN_MODIFY, file_wd),
|
||||
}));
|
||||
if (events.size() == 4) {
|
||||
EXPECT_THAT(events, Are({
|
||||
Event(IN_MODIFY, dir_wd, Basename(file.path())),
|
||||
Event(IN_MODIFY, file_wd),
|
||||
Event(IN_MODIFY, dir_wd, Basename(file.path())),
|
||||
Event(IN_MODIFY, file_wd),
|
||||
}));
|
||||
} else {
|
||||
EXPECT_THAT(events, Are({
|
||||
Event(IN_MODIFY, dir_wd, Basename(file.path())),
|
||||
Event(IN_MODIFY, file_wd),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
// Watches on a parent should not be triggered by actions on a hard link to one
|
||||
|
||||
Reference in New Issue
Block a user