Update vendor of containers/(common,storage,image)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2022-04-22 06:45:18 -04:00
parent 145304b7cf
commit 8960ab3ce7
82 changed files with 1106 additions and 384 deletions

View File

@@ -344,7 +344,7 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) error {
return errors.Wrap(err, "error creating zfs mount")
}
defer func() {
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
if err := detachUnmount(mountpoint); err != nil {
logrus.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
}
}()
@@ -483,7 +483,7 @@ func (d *Driver) Put(id string) error {
logger.Debugf(`unmount("%s")`, mountpoint)
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
if err := detachUnmount(mountpoint); err != nil {
logger.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
}
if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {

View File

@@ -37,3 +37,8 @@ func getMountpoint(id string) string {
return id[:maxlen]
}
func detachUnmount(mountpoint string) error {
// FreeBSD doesn't have an equivalent to MNT_DETACH
return unix.Unmount(mountpoint, 0)
}

View File

@@ -4,6 +4,7 @@ import (
graphdriver "github.com/containers/storage/drivers"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
func checkRootdirFs(rootDir string) error {
@@ -27,3 +28,7 @@ func checkRootdirFs(rootDir string) error {
func getMountpoint(id string) string {
return id
}
func detachUnmount(mountpoint string) error {
return unix.Unmount(mountpoint, unix.MNT_DETACH)
}