Fix #33328
Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
... | ... |
@@ -13,6 +13,7 @@ import ( |
13 | 13 |
containertypes "github.com/docker/docker/api/types/container" |
14 | 14 |
mounttypes "github.com/docker/docker/api/types/mount" |
15 | 15 |
"github.com/docker/docker/pkg/chrootarchive" |
16 |
+ "github.com/docker/docker/pkg/mount" |
|
16 | 17 |
"github.com/docker/docker/pkg/stringid" |
17 | 18 |
"github.com/docker/docker/pkg/symlink" |
18 | 19 |
"github.com/docker/docker/pkg/system" |
... | ... |
@@ -220,7 +221,9 @@ func (container *Container) UnmountIpcMounts(unmount func(pth string) error) { |
220 | 220 |
warnings = append(warnings, err.Error()) |
221 | 221 |
} else if shmPath != "" { |
222 | 222 |
if err := unmount(shmPath); err != nil && !os.IsNotExist(err) { |
223 |
- warnings = append(warnings, fmt.Sprintf("failed to umount %s: %v", shmPath, err)) |
|
223 |
+ if mounted, mErr := mount.Mounted(shmPath); mounted || mErr != nil { |
|
224 |
+ warnings = append(warnings, fmt.Sprintf("failed to umount %s: %v", shmPath, err)) |
|
225 |
+ } |
|
224 | 226 |
} |
225 | 227 |
|
226 | 228 |
} |