Merge pull request #967 from nalind/overlay-needs-whiteout

overlay: check if we can mknod() kernel whiteout
This commit is contained in:
Daniel J Walsh 2021-07-21 14:59:26 -04:00 committed by GitHub
commit 87fdb6d0eb
1 changed files with 4 additions and 0 deletions

View File

@ -613,6 +613,10 @@ func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGI
if unshare.IsRootless() {
flags = fmt.Sprintf("%s,userxattr", flags)
}
if err := syscall.Mknod(filepath.Join(upperDir, "whiteout"), syscall.S_IFCHR|0600, int(unix.Mkdev(0, 0))); err != nil {
logrus.Debugf("unable to create kernel-style whiteout: %v", err)
return supportsDType, errors.Wrapf(err, "unable to create kernel-style whiteout")
}
if len(flags) < unix.Getpagesize() {
err := unix.Mount("overlay", mergedDir, "overlay", 0, flags)