From a407c016021cf1eb22d525c368ad06c9575086a0 Mon Sep 17 00:00:00 2001 From: Changxin Miao Date: Wed, 25 Sep 2024 11:49:42 +0800 Subject: [PATCH] Fix: os.Chmod is called on every cache/stage write (#5185) Signed-off-by: Changxin Miao --- pkg/chunk/disk_cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/chunk/disk_cache.go b/pkg/chunk/disk_cache.go index 74c7ab30c9e3..1a7440a19d33 100644 --- a/pkg/chunk/disk_cache.go +++ b/pkg/chunk/disk_cache.go @@ -503,7 +503,7 @@ func (cache *cacheStore) createDir(dir string) { _ = os.Mkdir(dir, mode) // umask may remove some permissions return os.Chmod(dir, mode) - } else if strings.HasPrefix(dir, cache.dir) && err == nil && st.Mode() != mode { + } else if strings.HasPrefix(dir, cache.dir) && err == nil && st.Mode().Perm() != mode.Perm() { // check permission only changeMode(dir, st, mode) } return err