Generalize safe host-to-isolated rename migration

This commit is contained in:
ms2k 2026-07-29 22:20:04 +09:00
commit 35ab7f17c0

View file

@ -0,0 +1,28 @@
diff --git a/runsc/boot/vfs.go b/runsc/boot/vfs.go
index b34854d4c..b250b78c8 100644
--- a/runsc/boot/vfs.go
+++ b/runsc/boot/vfs.go
@@ -330,6 +330,9 @@ func goferMountData(fd int, fa config.FileAccessType, conf *config.Config, suppre
if fa == config.FileAccessShared {
opts = append(opts, "cache=remote_revalidating")
}
+ if suppressDirectFS {
+ opts = append(opts, "disable_file_handle_sharing")
+ }
if conf.DirectFS && !suppressDirectFS {
opts = append(opts, "directfs")
}
diff --git a/runsc/boot/vfs_test.go b/runsc/boot/vfs_test.go
index 17ec62bdd..31a103d28 100644
--- a/runsc/boot/vfs_test.go
+++ b/runsc/boot/vfs_test.go
@@ -108,6 +108,9 @@ func TestGoferMountDataDirectFS(t *testing.T) {
if gotEnabled != tc.wantEnabled {
t.Errorf("directfs option present = %t, want %t (opts=%v)", gotEnabled, tc.wantEnabled, opts)
}
+ if got := slices.Contains(opts, "disable_file_handle_sharing"); got != tc.suppressDirectFS {
+ t.Errorf("disable_file_handle_sharing option present = %t, want %t (opts=%v)", got, tc.suppressDirectFS, opts)
+ }
})
}
}