From e403f675732389a650e06a99d387c4ed24f0d6bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?okhowang=28=E7=8E=8B=E6=B2=9B=E6=96=87=29?= Date: Fri, 29 May 2026 15:51:41 +0800 Subject: [PATCH] fix: remove volatile flag in temp mount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: okhowang(王沛文) --- cache/refs.go | 2 ++ snapshot/localmounter_linux.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cache/refs.go b/cache/refs.go index 1ad7caf473fc..1e0bf2187c16 100644 --- a/cache/refs.go +++ b/cache/refs.go @@ -1808,6 +1808,8 @@ func (sm *sharableMountable) Mount() (_ []mount.Mount, _ func() error, retErr er return nil, nil, err } } + + mounts = mount.RemoveVolatileOption(mounts) if err := mount.All(mounts, dir); err != nil { return nil, nil, err } diff --git a/snapshot/localmounter_linux.go b/snapshot/localmounter_linux.go index a8132c9a7d3b..c17556c7ed7b 100644 --- a/snapshot/localmounter_linux.go +++ b/snapshot/localmounter_linux.go @@ -37,6 +37,8 @@ func (lm *localMounter) Mount() (string, error) { } } + lm.mounts = mount.RemoveVolatileOption(lm.mounts) + var isFile bool if len(lm.mounts) == 1 && (lm.mounts[0].Type == "bind" || lm.mounts[0].Type == "rbind") { if !lm.forceRemount {