diff --git a/VERSION-vendor b/VERSION-vendor index 2629cb6ea37c115f5c9046aece19a041eceb102d..f9d5bb2c791805ee32045c8cdbeec0b4d3cd6200 100644 --- a/VERSION-vendor +++ b/VERSION-vendor @@ -1 +1 @@ -18.09.0.328 +18.09.0.329 diff --git a/docker.spec b/docker.spec index 9947fe0b88845c10771c2e5d0bd019c600f57b70..a8def92d9716037981dce3e1fa949fe5f7c8a7d9 100644 --- a/docker.spec +++ b/docker.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 328 +Release: 329 Epoch: 2 Summary: The open-source application container engine Group: Tools/Docker @@ -229,6 +229,12 @@ fi %endif %changelog +* Sat Aug 26 2023 chenjiankun - 18.09.0-329 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:remove useless mount point dir + * Fri Jul 28 2023 jingxiaolu - 18.09.0-328 - Type:bugfix - CVE:NA diff --git a/git-commit b/git-commit index 1e1ddeecf95172b0860ed91760de565bdf9bd29c..6372c5c71bd00f8ddfba6259775f71b229b92294 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -458f41acf23755199655213371d48851fd11256e +b6b7823cc9a4211b105d0082b0f2f2308d739b9f diff --git a/patch/0262-docker-remove-useless-mount-point-dir.patch b/patch/0262-docker-remove-useless-mount-point-dir.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c6ae86ee5e549a36a0a776a04acaceb65979d4c --- /dev/null +++ b/patch/0262-docker-remove-useless-mount-point-dir.patch @@ -0,0 +1,83 @@ +From bd1ebe87b72eaad2f213d554139eef478af95285 Mon Sep 17 00:00:00 2001 +From: chenjiankun +Date: Tue, 4 Jul 2023 19:43:54 +0800 +Subject: [PATCH] docker: remove useless mount point dir + +Concurrent execution of docker pull and restart dockerd, some mount point +dir may be left over. The reason is there is no time to do cleanup operation. +So we can cleanup the mount point dir when start dockerd. +--- + .../daemon/graphdriver/devmapper/driver.go | 32 +++++++++++++++---- + 1 file changed, 26 insertions(+), 6 deletions(-) + +diff --git a/components/engine/daemon/graphdriver/devmapper/driver.go b/components/engine/daemon/graphdriver/devmapper/driver.go +index a1a6e17af..e6ad26e32 100644 +--- a/components/engine/daemon/graphdriver/devmapper/driver.go ++++ b/components/engine/daemon/graphdriver/devmapper/driver.go +@@ -19,6 +19,7 @@ import ( + "github.com/docker/go-units" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" ++ "golang.org/x/sys/unix" + ) + + func init() { +@@ -127,11 +128,25 @@ func (d *Driver) GetMetadata(id string) (map[string]string, error) { + + // GetAll not implemented + func (d *Driver) GetAll() []string { +- ids := []string{} +- for id, _ := range d.DeviceSet.Devices { +- ids = append(ids, id) +- } +- return ids ++ ids := []string{} ++ ++ for id, _ := range d.DeviceSet.Devices { ++ ids = append(ids, id) ++ } ++ ++ fs, err := ioutil.ReadDir(path.Join(d.home, "mnt")) ++ if err != nil { ++ logrus.Errorf("open directory(%s) failed: %s", d.home, err) ++ return ids ++ } ++ ++ for _, f := range fs { ++ if dir, _ := ioutil.ReadDir(path.Join(d.home, "mnt", f.Name())); len(f.Name()) >= 64 && len(dir) == 0 { ++ ids = append(ids, f.Name()) ++ } ++ } ++ ++ return ids + } + + // CheckParent not implemented +@@ -175,10 +190,15 @@ func (d *Driver) Create(id, parent string, opts *graphdriver.CreateOpts) error { + func (d *Driver) Remove(id string) error { + d.locker.Lock(id) + defer d.locker.Unlock(id) ++ ++ mp := path.Join(d.home, "mnt", id) + if !d.DeviceSet.HasDevice(id) { + // Consider removing a non-existing device a no-op + // This is useful to be able to progress on container removal + // if the underlying device has gone away due to earlier errors ++ if err := unix.Rmdir(mp); err != nil { ++ logrus.WithField("storage-driver", "devicemapper").Warnf("unable to remove redundancy mount point %q: %s", mp, err) ++ } + return nil + } + +@@ -194,7 +214,7 @@ func (d *Driver) Remove(id string) error { + // to other mount namespaces. A failure to remove the container's + // mount point is not important and should not be treated + // as a failure to remove the container. +- mp := path.Join(d.home, "mnt", id) ++ + // In some cases, there are some files in the mount point dir, so we can't use + // unix.Rmdir to remove mount point dir. os.RemoveAll is more appropriate + err := os.RemoveAll(mp) +-- +2.33.0 + diff --git a/series.conf b/series.conf index de99bf08ec2b382bc9811054971ce1fc8c1d666c..d09bb770e93ace61cff9c4408e08059af6529bc5 100644 --- a/series.conf +++ b/series.conf @@ -259,4 +259,5 @@ patch/0258-docker-thinpool-full-because-kill-docker-daemon-when.patch patch/0259-backport-fix-blockThreshold-full-bug.patch patch/0260-docker-repalce-unix.Rmdir-with-os.RemoveAll-when-rem.patch patch/0261-backport-client-define-a-dummy-hostname-to-use-for-local-conn.patch +patch/0262-docker-remove-useless-mount-point-dir.patch #end