overlay: do not attempt metacopyup when using a mount program

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
This commit is contained in:
Giuseppe Scrivano 2019-01-21 10:10:25 +01:00
parent f749f85350
commit 308b57a78f
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 10 additions and 10 deletions

View File

@ -158,6 +158,7 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
return nil, err
}
var usingMetacopy bool
var supportsDType bool
if opts.mountProgram != "" {
supportsDType = true
@ -172,18 +173,17 @@ func Init(home string, options []string, uidMaps, gidMaps []idtools.IDMap) (grap
}
return nil, errors.Wrap(err, "kernel does not support overlay fs")
}
}
usingMetacopy, err := doesMetacopy(home, opts.mountOptions)
if err == nil {
if usingMetacopy {
logrus.Debugf("overlay test mount indicated that metacopy is being used")
usingMetacopy, err = doesMetacopy(home, opts.mountOptions)
if err == nil {
if usingMetacopy {
logrus.Debugf("overlay test mount indicated that metacopy is being used")
} else {
logrus.Debugf("overlay test mount indicated that metacopy is not being used")
}
} else {
logrus.Debugf("overlay test mount indicated that metacopy is not being used")
logrus.Warnf("overlay test mount did not indicate whether or not metacopy is being used: %v", err)
return nil, err
}
} else {
logrus.Warnf("overlay test mount did not indicate whether or not metacopy is being used: %v", err)
return nil, err
}
if !opts.skipMountHome {