From 5e594d035ddd8ce24b719d9fedbc9c90d13c2e10 Mon Sep 17 00:00:00 2001 From: Phil Estes Date: Fri, 14 Jul 2017 15:42:44 -0400 Subject: [PATCH] Update containerd/fifo for race fix Re-vendor containerd/fifo to pick up PR #13 to fix data race. Signed-off-by: Phil Estes --- vendor.conf | 2 +- vendor/github.com/containerd/fifo/handle_linux.go | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/vendor.conf b/vendor.conf index b4251bdfd..1e0c08a2f 100644 --- a/vendor.conf +++ b/vendor.conf @@ -21,7 +21,7 @@ github.com/containerd/btrfs e9c546f46bccffefe71a6bc137e4c21b5503cc18 github.com/stretchr/testify v1.1.4 github.com/davecgh/go-spew v1.1.0 github.com/pmezard/go-difflib v1.0.0 -github.com/containerd/fifo 69b99525e472735860a5269b75af1970142b3062 +github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6 github.com/urfave/cli 8ba6f23b6e36d03666a14bd9421f5e3efcb59aca golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6 google.golang.org/grpc v1.3.0 diff --git a/vendor/github.com/containerd/fifo/handle_linux.go b/vendor/github.com/containerd/fifo/handle_linux.go index 520ef262a..8b9c66304 100644 --- a/vendor/github.com/containerd/fifo/handle_linux.go +++ b/vendor/github.com/containerd/fifo/handle_linux.go @@ -15,6 +15,7 @@ const O_PATH = 010000000 type handle struct { f *os.File + fd uintptr dev uint64 ino uint64 closeOnce sync.Once @@ -27,10 +28,13 @@ func getHandle(fn string) (*handle, error) { return nil, errors.Wrapf(err, "failed to open %v with O_PATH", fn) } - var stat syscall.Stat_t - if err := syscall.Fstat(int(f.Fd()), &stat); err != nil { + var ( + stat syscall.Stat_t + fd = f.Fd() + ) + if err := syscall.Fstat(int(fd), &stat); err != nil { f.Close() - return nil, errors.Wrapf(err, "failed to stat handle %v", f.Fd()) + return nil, errors.Wrapf(err, "failed to stat handle %v", fd) } h := &handle{ @@ -38,6 +42,7 @@ func getHandle(fn string) (*handle, error) { name: fn, dev: uint64(stat.Dev), ino: stat.Ino, + fd: fd, } // check /proc just in case @@ -50,7 +55,7 @@ func getHandle(fn string) (*handle, error) { } func (h *handle) procPath() string { - return fmt.Sprintf("/proc/self/fd/%d", h.f.Fd()) + return fmt.Sprintf("/proc/self/fd/%d", h.fd) } func (h *handle) Name() string {