1 Star 0 Fork 58

gnaygnil/docker

forked from src-openEuler/docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0023-prjquota-fix-syscall-bugs-in-projectquota.patch 2.40 KB
一键复制 编辑 原始数据 按行查看 历史
gnaygnil 提交于 2020-02-13 15:36 . docker: Fixed build error and URL
From d864d32460063a25ef5a408c596b40555a062646 Mon Sep 17 00:00:00 2001
From: lujingxiao <lujingxiao@huawei.com>
Date: Sat, 19 Jan 2019 15:02:39 +0800
Subject: [PATCH 023/111] prjquota: fix syscall bugs in projectquota
reason: fix syscall bugs in projectquota, which is introduced
when cherry-picked.
Change-Id: I4496f2b8fcdcd16eb34584b435a9ef9434639cee
Signed-off-by: lujingxiao <lujingxiao@huawei.com>
---
.../engine/daemon/graphdriver/quota/projectquota.go | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/components/engine/daemon/graphdriver/quota/projectquota.go b/components/engine/daemon/graphdriver/quota/projectquota.go
index 7d879eb81d..7f2fa2fe70 100644
--- a/components/engine/daemon/graphdriver/quota/projectquota.go
+++ b/components/engine/daemon/graphdriver/quota/projectquota.go
@@ -79,7 +79,6 @@ import (
"path"
"path/filepath"
"sync"
- "syscall"
"unsafe"
rsystem "github.com/opencontainers/runc/libcontainer/system"
@@ -234,7 +233,7 @@ func (q *Control) SetQuota(targetPath string, quota Quota) error {
//
err := setProjectID(targetPath, projectID)
if err != nil {
- q.lock.Lock()
+ q.lock.Unlock()
return err
}
@@ -312,7 +311,7 @@ func (q *Ext4Quota) SetProjectQuota(backingFsBlockDev string, projectID uint32,
var cs = C.CString(backingFsBlockDev)
defer C.free(unsafe.Pointer(cs))
- _, _, errno := syscall.Syscall6(syscall.SYS_QUOTACTL, C.Q_SETPQUOTA,
+ _, _, errno := unix.Syscall6(unix.SYS_QUOTACTL, C.Q_SETPQUOTA,
uintptr(unsafe.Pointer(cs)), uintptr(C.__u32(projectID)),
uintptr(unsafe.Pointer(&d)), 0, 0)
if errno != 0 {
@@ -330,7 +329,7 @@ func (q *Ext4Quota) GetProjectQuota(backingFsBlockDev string, projectID uint32,
var cs = C.CString(backingFsBlockDev)
defer C.free(unsafe.Pointer(cs))
- _, _, errno := syscall.Syscall6(syscall.SYS_QUOTACTL, C.Q_SETPQUOTA,
+ _, _, errno := unix.Syscall6(unix.SYS_QUOTACTL, C.Q_GETPQUOTA,
uintptr(unsafe.Pointer(cs)), uintptr(C.__u32(projectID)),
uintptr(unsafe.Pointer(&d)), 0, 0)
if errno != 0 {
@@ -350,7 +349,7 @@ func getQuotaStat(backingFsBlockDev string) (int, error) {
var cs = C.CString(backingFsBlockDev)
defer C.free(unsafe.Pointer(cs))
- _, _, errno := syscall.Syscall6(syscall.SYS_QUOTACTL, C.Q_XGETPQSTAT,
+ _, _, errno := unix.Syscall6(unix.SYS_QUOTACTL, C.Q_XGETPQSTAT,
uintptr(unsafe.Pointer(cs)), 0,
uintptr(unsafe.Pointer(&info)), 0, 0)
if errno != 0 {
--
2.17.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gnaygnil/docker.git
git@gitee.com:gnaygnil/docker.git
gnaygnil
docker
docker
master

搜索帮助