From 0b3bfe2ea30d491a6533f8ee74eb6e3cea707f06 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Mon, 27 Aug 2018 14:25:21 -0700 Subject: fs: Fix remote-revalidate cache policy. When revalidating a Dirent, if the inode id is the same, then we don't need to throw away the entire Dirent. We can just update the unstable attributes in place. If the inode id has changed, then the remote file has been deleted or moved, and we have no choice but to throw away the dirent we have a look up another. In this case, we may still end up losing a mounted dirent that is a child of the revalidated dirent. However, that seems appropriate here because the entire mount point has been pulled out from underneath us. Because gVisor's overlay is at the Inode level rather than the Dirent level, we must pass the parent Inode and name along with the Inode that is being revalidated. PiperOrigin-RevId: 210431270 Change-Id: I705caef9c68900234972d5aac4ae3a78c61c7d42 --- runsc/container/container_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'runsc/container/container_test.go') diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go index 25aaf3f86..4ce3afc91 100644 --- a/runsc/container/container_test.go +++ b/runsc/container/container_test.go @@ -134,7 +134,13 @@ func waitForFile(f *os.File) error { } return nil } - return testutil.Poll(op, 5*time.Second) + + timeout := 5 * time.Second + if testutil.RaceEnabled { + // Race makes slow things even slow, so bump the timeout. + timeout = 3 * timeout + } + return testutil.Poll(op, timeout) } // readOutputNum reads a file at given filepath and returns the int at the @@ -213,10 +219,8 @@ const ( nonExclusiveFS ) -// TODO: nonExclusiveFS was removed because it causes timeout -// with --race. Put it back when bug is fixed. -var all = []configOption{overlay, kvm} -var noOverlay = []configOption{kvm} +var noOverlay = []configOption{kvm, nonExclusiveFS} +var all = append(noOverlay, overlay) // configs generates different configurations to run tests. func configs(opts ...configOption) []*boot.Config { @@ -1572,10 +1576,6 @@ func TestContainerVolumeContentsShared(t *testing.T) { // the filesystem. spec := testutil.NewSpecWithArgs("sleep", "1000") - // TODO: $TEST_TMPDIR mount is mistakenly marked as RO after - // revalidation. Remove when it's fixed. - spec.Root.Readonly = false - dir, err := ioutil.TempDir(testutil.TmpDir(), "root-fs-test") if err != nil { t.Fatalf("TempDir failed: %v", err) -- cgit v1.2.3