From 039389769569b27c1c4ec311c948beba3f791e05 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Thu, 29 Dec 2022 02:37:39 +0800 Subject: [PATCH] daemon/graphdriver/btrfs: workaround field rename in btrfs-progs 6.1 Closes: #44698 Signed-off-by: Shengjing Zhu (cherry picked from commit ffbbe3d103b045c3f8ec5f74aa71b7a314fd57fe) Signed-off-by: Shengjing Zhu --- daemon/graphdriver/btrfs/btrfs.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/graphdriver/btrfs/btrfs.go b/daemon/graphdriver/btrfs/btrfs.go index f8967dc915..4158470a9d 100644 --- a/daemon/graphdriver/btrfs/btrfs.go +++ b/daemon/graphdriver/btrfs/btrfs.go @@ -6,6 +6,9 @@ package btrfs // import "github.com/docker/docker/daemon/graphdriver/btrfs" /* #include #include + +// keep struct field name compatible with btrfs-progs < 6.1. +#define max_referenced max_rfer #include #include @@ -395,7 +398,7 @@ func subvolLimitQgroup(path string, size uint64) error { defer closeDir(dir) var args C.struct_btrfs_ioctl_qgroup_limit_args - args.lim.max_referenced = C.__u64(size) + args.lim.max_rfer = C.__u64(size) args.lim.flags = C.BTRFS_QGROUP_LIMIT_MAX_RFER _, _, errno := unix.Syscall(unix.SYS_IOCTL, getDirFd(dir), C.BTRFS_IOC_QGROUP_LIMIT, uintptr(unsafe.Pointer(&args)))