[arch-commits] Commit in docker/trunk (01-golang15.patch PKGBUILD)

Sébastien Luttringer seblu at archlinux.org
Mon Sep 14 12:11:42 UTC 2015


    Date: Monday, September 14, 2015 @ 14:11:42
  Author: seblu
Revision: 140083

upgpkg: docker 1:1.8.2-1

Added:
  docker/trunk/01-golang15.patch
Modified:
  docker/trunk/PKGBUILD

-------------------+
 01-golang15.patch |   87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD          |   12 +++++--
 2 files changed, 96 insertions(+), 3 deletions(-)

Added: 01-golang15.patch
===================================================================
--- 01-golang15.patch	                        (rev 0)
+++ 01-golang15.patch	2015-09-14 12:11:42 UTC (rev 140083)
@@ -0,0 +1,87 @@
+From 0a426878b52e9eaa243df117ece0608804c28d29 Mon Sep 17 00:00:00 2001
+From: Vincent Batts <vbatts at redhat.com>
+Date: Fri, 7 Aug 2015 10:18:20 -0400
+Subject: [PATCH] devicemapper: fix zero-sized field access
+
+Fixes: #15279
+
+Due to
+https://github.com/golang/go/commit/7904946eeb35faece61bbf6f5b3cc8be2f519c17
+the devices field is dropped.
+
+This solution works on go1.4 and go1.5
+
+Signed-off-by: Vincent Batts <vbatts at redhat.com>
+
+Vincent Batts <vbatts at redhat.com>
+---
+ daemon/graphdriver/devmapper/deviceset.go | 14 +++++++++-----
+ pkg/devicemapper/devmapper_wrapper.go     | 18 +++++++++++++++---
+ 2 files changed, 24 insertions(+), 8 deletions(-)
+
+diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go
+index 3c90fed..e3106fc 100644
+--- a/daemon/graphdriver/devmapper/deviceset.go
++++ b/daemon/graphdriver/devmapper/deviceset.go
+@@ -1485,12 +1485,16 @@ func (devices *DeviceSet) deactivatePool() error {
+ 	if err != nil {
+ 		return err
+ 	}
+-	if d, err := devicemapper.GetDeps(devname); err == nil {
+-		// Access to more Debug output
+-		logrus.Debugf("[devmapper] devicemapper.GetDeps() %s: %#v", devname, d)
++
++	if devinfo.Exists == 0 {
++		return nil
+ 	}
+-	if devinfo.Exists != 0 {
+-		return devicemapper.RemoveDevice(devname)
++	if err := devicemapper.RemoveDevice(devname); err != nil {
++		return err
++	}
++
++	if d, err := devicemapper.GetDeps(devname); err == nil {
++		logrus.Warnf("[devmapper] device %s still has %d active dependents", devname, d.Count)
+ 	}
+ 
+ 	return nil
+diff --git a/pkg/devicemapper/devmapper_wrapper.go b/pkg/devicemapper/devmapper_wrapper.go
+index 87c2003..44ca772 100644
+--- a/pkg/devicemapper/devmapper_wrapper.go
++++ b/pkg/devicemapper/devmapper_wrapper.go
+@@ -38,7 +38,10 @@ static void	log_with_errno_init()
+ */
+ import "C"
+ 
+-import "unsafe"
++import (
++	"reflect"
++	"unsafe"
++)
+ 
+ type (
+ 	CDmTask C.struct_dm_task
+@@ -184,12 +187,21 @@ func dmTaskGetDepsFct(task *CDmTask) *Deps {
+ 	if Cdeps == nil {
+ 		return nil
+ 	}
++
++	// golang issue: https://github.com/golang/go/issues/11925
++	hdr := reflect.SliceHeader{
++		Data: uintptr(unsafe.Pointer(uintptr(unsafe.Pointer(Cdeps)) + unsafe.Sizeof(*Cdeps))),
++		Len:  int(Cdeps.count),
++		Cap:  int(Cdeps.count),
++	}
++	devices := *(*[]C.uint64_t)(unsafe.Pointer(&hdr))
++
+ 	deps := &Deps{
+ 		Count:  uint32(Cdeps.count),
+ 		Filler: uint32(Cdeps.filler),
+ 	}
+-	for _, device := range Cdeps.device {
+-		deps.Device = append(deps.Device, (uint64)(device))
++	for _, device := range devices {
++		deps.Device = append(deps.Device, uint64(device))
+ 	}
+ 	return deps
+ }

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-09-14 10:23:06 UTC (rev 140082)
+++ PKGBUILD	2015-09-14 12:11:42 UTC (rev 140083)
@@ -2,7 +2,7 @@
 # Maintainer: Sébastien "Seblu" Luttringer
 
 pkgname=docker
-pkgver=1.8.1
+pkgver=1.8.2
 pkgrel=1
 epoch=1
 pkgdesc='Pack, ship and run any application as a lightweight container'
@@ -17,10 +17,16 @@
 options=('!strip')
 install=$pkgname.install
 source=("git+https://github.com/docker/docker.git#tag=v$pkgver"
-        "$pkgname.sysusers")
+        "$pkgname.sysusers"
+        '01-golang15.patch')
 md5sums=('SKIP'
-         '8cf9900ebada61f352a03465a088da34')
+         '8cf9900ebada61f352a03465a088da34'
+         '0511f2bbc52219a960dc91ea9c2d9e44')
 
+prepare() {
+  patch -p1 -d docker < 01-golang15.patch
+}
+
 build() {
   cd docker
   export AUTO_GOPATH=1



More information about the arch-commits mailing list