1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #43472 from thaJeztah/no_more_no_d_type

remove deprecated support for overlay(2) on backing FS without d_type (fstype=1)
This commit is contained in:
Sebastiaan van Stijn 2022-04-08 09:22:57 +02:00 committed by GitHub
commit 62ea92ba14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 22 deletions

View file

@ -294,18 +294,6 @@ func scanPriorDrivers(root string) map[string]bool {
return driversMap return driversMap
} }
// IsInitialized checks if the driver's home-directory exists and is non-empty.
func IsInitialized(driverHome string) bool {
_, err := os.Stat(driverHome)
if os.IsNotExist(err) {
return false
}
if err != nil {
logrus.Warnf("graphdriver.IsInitialized: stat failed: %v", err)
}
return !isEmptyDir(driverHome)
}
// isEmptyDir checks if a directory is empty. It is used to check if prior // isEmptyDir checks if a directory is empty. It is used to check if prior
// storage-driver directories exist. If an error occurs, it also assumes the // storage-driver directories exist. If an error occurs, it also assumes the
// directory is not empty (which preserves the behavior _before_ this check // directory is not empty (which preserves the behavior _before_ this check

View file

@ -147,11 +147,7 @@ func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdr
return nil, err return nil, err
} }
if !supportsDType { if !supportsDType {
if !graphdriver.IsInitialized(home) { return nil, overlayutils.ErrDTypeNotSupported("overlay", backingFs)
return nil, overlayutils.ErrDTypeNotSupported("overlay", backingFs)
}
// allow running without d_type only for existing setups (#27443)
logrus.WithField("storage-driver", "overlay").Warn(overlayutils.ErrDTypeNotSupported("overlay", backingFs))
} }
currentID := idtools.CurrentIdentity() currentID := idtools.CurrentIdentity()

View file

@ -156,11 +156,7 @@ func Init(home string, options []string, idMap idtools.IdentityMapping) (graphdr
return nil, err return nil, err
} }
if !supportsDType { if !supportsDType {
if !graphdriver.IsInitialized(home) { return nil, overlayutils.ErrDTypeNotSupported("overlay2", backingFs)
return nil, overlayutils.ErrDTypeNotSupported("overlay2", backingFs)
}
// allow running without d_type only for existing setups (#27443)
logger.Warn(overlayutils.ErrDTypeNotSupported("overlay2", backingFs))
} }
cur := idtools.CurrentIdentity() cur := idtools.CurrentIdentity()