diff options
author | Jamie Liu <jamieliu@google.com> | 2021-10-12 10:23:01 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-12 10:25:30 -0700 |
commit | 8682ce689e928ec32ec810a7eb038fb582c66093 (patch) | |
tree | 055b5c20bf179fe839ac6da0ceb434c7effbc512 /test | |
parent | ab1ef0baba1d15c4d4e7717d23cf8b32fd6b5feb (diff) |
Remove state:"nosave"/"zerovalue" annotations from all waiter.Queues.
Prior to cl/318010298, //pkg/state couldn't handle pointers to struct fields,
which meant that it couldn't handle intrusive linked lists, which meant that it
couldn't handle waiter.Queue, which meant that it couldn't handle epoll. As a
result, VFS1 unregisters all epoll waiters before saving and re-registers them
after loading, and waitable VFS1 file implementations tag their waiter.Queues
state:"nosave" (causing them to be skipped by the save/restore machinery) or
state:"zerovalue" (causing them to only be checked for zero-value-equality on
save).
VFS2 required cl/318010298 to support save/restore (due to the Impl inheritance
pattern used by vfs.FileDescription, vfs.Dentry, etc.); correspondingly, VFS2
epoll assumes that waiter.Queues *will be* saved and loaded correctly, and VFS2
file implementations do not tag waiter.Queues.
Some waiter.Queues, e.g. pipe.Pipe.Queue and kernel.Task.signalQueue, are used
by both VFS1 and VFS2 (the latter via signalfd); as a result of the above,
tagging these Queues state:"nosave" or state:"zerovalue" breaks VFS2 epoll.
Remove VFS1 epoll unregistration before saving (bringing it in line with VFS2),
and remove these tags from all waiter.Queues.
Also clean up after the epoll test added by cl/402323053, which implied this
issue (by instantiating DisableSave in the new test) without reporting it.
PiperOrigin-RevId: 402596216
Diffstat (limited to 'test')
-rw-r--r-- | test/syscalls/linux/BUILD | 1 | ||||
-rw-r--r-- | test/syscalls/linux/epoll.cc | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/test/syscalls/linux/BUILD b/test/syscalls/linux/BUILD index e37d0402f..b96005d7d 100644 --- a/test/syscalls/linux/BUILD +++ b/test/syscalls/linux/BUILD @@ -588,7 +588,6 @@ cc_binary( "//test/util:file_descriptor", gtest, "//test/util:posix_error", - "//test/util:socket_util", "//test/util:test_main", "//test/util:test_util", "//test/util:thread_util", diff --git a/test/syscalls/linux/epoll.cc b/test/syscalls/linux/epoll.cc index 600a40ef8..b1760b7d6 100644 --- a/test/syscalls/linux/epoll.cc +++ b/test/syscalls/linux/epoll.cc @@ -498,7 +498,6 @@ TEST(EpollTest, PipeReaderHupAfterWriterClosed) { } TEST(EpollTest, DoubleLayerEpoll) { - DisableSave ds; int pipefds[2]; ASSERT_THAT(pipe(pipefds), SyscallSucceeds()); FileDescriptor rfd(pipefds[0]); @@ -522,10 +521,10 @@ TEST(EpollTest, DoubleLayerEpoll) { }); struct epoll_event ret_events[2]; - ASSERT_THAT(RetryEINTR(epoll_wait)(epfd2.get(), ret_events, 2, 2000), + ASSERT_THAT(RetryEINTR(epoll_wait)(epfd2.get(), ret_events, 2, 5000), SyscallSucceedsWithValue(1)); ASSERT_EQ(ret_events[0].data.fd, epfd1.get()); - ASSERT_THAT(RetryEINTR(epoll_wait)(epfd1.get(), ret_events, 2, 2000), + ASSERT_THAT(RetryEINTR(epoll_wait)(epfd1.get(), ret_events, 2, 5000), SyscallSucceedsWithValue(1)); ASSERT_EQ(ret_events[0].data.fd, rfd.get()); char readBuf[sizeof(data)]; |