From 6669c86fdf1ae07b66a6e178e269d797f6397bca Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 8 Nov 2013 11:56:34 -0800 Subject: [PATCH] Use tmp dir in driver home --- aufs/aufs.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aufs/aufs.go b/aufs/aufs.go index 22fa487f3a..f47c65e661 100644 --- a/aufs/aufs.go +++ b/aufs/aufs.go @@ -158,7 +158,10 @@ func (a *AufsDriver) Remove(id string) error { // Remove the dirs atomically for _, p := range tmpDirs { - tmp := path.Join(os.TempDir(), p, id) + // We need to use a temp dir in the same dir as the driver so Rename + // does not fall back to the slow copy if /tmp and the driver dir + // are on different devices + tmp := path.Join(a.rootPath(), "tmp", p, id) if err := os.MkdirAll(tmp, 0755); err != nil { return err }