Skip to content

Commit

Permalink
Fix: os.Chmod is called on every cache/stage write
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit committed Sep 23, 2024
1 parent a977aeb commit c8fbf2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/chunk/disk_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8fbf2f

Please sign in to comment.