Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
snapshots|pkg: umount without DETACH and nosync after umount
Signed-off-by: Wei Fu <[email protected]>
  • Loading branch information
fuweid committed Jun 15, 2023
commit 6dfb16f99a3bbafb31a93752c61461c77f23db9d
2 changes: 2 additions & 0 deletions pkg/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
"github.com/stretchr/testify/assert"
)

const umountflags int = 0

var rootEnabled bool

func init() {
Expand Down
21 changes: 0 additions & 21 deletions pkg/testutil/mount_linux.go

This file was deleted.

22 changes: 0 additions & 22 deletions pkg/testutil/mount_other.go

This file was deleted.

2 changes: 1 addition & 1 deletion snapshots/btrfs/btrfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func boltSnapshotter(t *testing.T) func(context.Context, string) (snapshots.Snap
if err := snapshotter.Close(); err != nil {
return err
}
err := mount.UnmountAll(root, unix.MNT_DETACH)
err := mount.UnmountAll(root, 0)
if cerr := loop.Close(); cerr != nil {
err = fmt.Errorf("device cleanup failed: %w", cerr)
}
Expand Down
2 changes: 2 additions & 0 deletions snapshots/testsuite/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"github.com/containerd/continuity/fs/fstest"
)

const umountflags int = 0

func applyToMounts(m []mount.Mount, work string, a fstest.Applier) (err error) {
td, err := os.MkdirTemp(work, "prepare")
if err != nil {
Expand Down
21 changes: 0 additions & 21 deletions snapshots/testsuite/helpers_linux.go

This file was deleted.

21 changes: 0 additions & 21 deletions snapshots/testsuite/helpers_other.go

This file was deleted.

1 change: 0 additions & 1 deletion snapshots/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ func check128LayersMount(name string) func(ctx context.Context, t *testing.T, sn
t.Fatalf("[layer %d] preparing doesn't equal to flat after apply: %+v", i, err)
}

sync()
testutil.Unmount(t, preparing)

parent = filepath.Join(work, fmt.Sprintf("committed-%d", i))
Expand Down
6 changes: 0 additions & 6 deletions snapshots/testsuite/testsuite_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ package testsuite

import (
"syscall"

"golang.org/x/sys/unix"
)

func clearMask() func() {
Expand All @@ -30,7 +28,3 @@ func clearMask() func() {
syscall.Umask(oldumask)
}
}

func sync() {
unix.Sync()
}
2 changes: 0 additions & 2 deletions snapshots/testsuite/testsuite_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ package testsuite
func clearMask() func() {
return func() {}
}

func sync() {}