diff --git a/VERSION-vendor b/VERSION-vendor index 756000ffe4b2f8cc9fb94d94681f22292151c8df..cfcaf4b936fa1932aeb2913a565e10980d79ba0f 100644 --- a/VERSION-vendor +++ b/VERSION-vendor @@ -1 +1 @@ -18.09.0.258 +18.09.0.259 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index da4db80abc4ef3cceb02308668820694537d67a3..c763ffd068bb67f363205a9e5d9d97c1effde24f 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 258 +Release: 259 Epoch: 1 Summary: The open-source application container engine Group: Tools/Docker @@ -199,6 +199,12 @@ fi %endif %changelog +* Mon Aug 28 2023 chenjiankun - 18.09.0-259 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:remove useless mount point dir + * Fri Jul 28 2023 jingxiaolu - 18.09.0-258 - Type:bugfix - CVE:NA 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 e170024ed28f9ad8256bfac3360398f2b0199063..954ff36cc1272cfdb96d675b7c14bed8b45a8070 100644 --- a/series.conf +++ b/series.conf @@ -250,4 +250,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