提交 34640cf2 编写于 作者: W WangFengTu

Get system's real page size

unix.Getpagesize use fixed 65536 as pagesize in arm64, but we need real
system pagesize. It usually to be 4096.
Signed-off-by: NWangFengTu <wangfengtu@huawei.com>
上级 cc772430
%global _version 2.0.0
%global _release 20200407.154716.git43a6aabf
%global _release 20200420.005423.git3cd302f6
Name: iSulad-img
Version: %{_version}
Release: %{_release}
......
From 484fc2ace248e41fea95c19d6b33684a315b9089 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Mon, 20 Apr 2020 10:35:59 +0800
Subject: [PATCH] Get system's real page size
unix.Getpagesize use fixed 65536 as pagesize in arm64, but we need real
system pagesize. It usually to be 4096.
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
.../containers/storage/drivers/overlay/overlay.go | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go
index 3e9f650..6b7d053 100644
--- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go
+++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go
@@ -14,6 +14,7 @@ import (
"strconv"
"strings"
"sync"
+ "syscall"
"bufio"
"github.com/containers/storage/drivers"
@@ -344,7 +345,7 @@ func supportsMultipleLowerDir(home string, homeMagic graphdriver.FsMagic, rootUI
_ = idtools.MkdirAs(lower1Dir, 0700, rootUID, rootGID)
_ = idtools.MkdirAs(lower2Dir, 0700, rootUID, rootGID)
flags := fmt.Sprintf("lowerdir=%s:%s", lower1Dir, lower2Dir)
- if len(flags) < unix.Getpagesize() {
+ if len(flags) < syscall.Getpagesize() {
err := mountFrom(filepath.Dir(home), "overlay", mergedDir, "overlay", 0, flags)
if err == nil {
logrus.Debugf("overlay test mount with multiple lowers succeeded")
@@ -354,7 +355,7 @@ func supportsMultipleLowerDir(home string, homeMagic graphdriver.FsMagic, rootUI
}
}
flags = fmt.Sprintf("lowerdir=%s", lower1Dir)
- if len(flags) < unix.Getpagesize() {
+ if len(flags) < syscall.Getpagesize() {
err := mountFrom(filepath.Dir(home), "overlay", mergedDir, "overlay", 0, flags)
if err == nil {
logrus.Errorf("overlay test mount with multiple lowers failed, but succeeded with a single lower")
@@ -815,7 +816,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
mountFunc := unix.Mount
mountTarget := mergedDir
- pageSize := unix.Getpagesize()
+ pageSize := syscall.Getpagesize()
// Use relative paths and mountFrom when the mount data has exceeded
// the page size. The mount syscall fails if the mount data cannot
--
2.19.1
......@@ -48,3 +48,4 @@
0048-Check-all-links-in-lowers-file-but-not-parent-link-o.patch
0049-Delete-related-names-when-delete-layer.patch
0050-calculate-target-size-if-layer-blob-is-symlink.patch
0051-Get-system-s-real-page-size.patch
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册