Skip to content

Commit a8008f7

Browse files
committed
overlayutils/userxattr.go: add "fast path" for kernel >= 5.11.0
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 11ef8d3 commit a8008f7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

daemon/graphdriver/overlayutils/userxattr.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727

2828
"github.com/containerd/containerd/mount"
2929
"github.com/containerd/containerd/sys"
30+
"github.com/docker/docker/pkg/parsers/kernel"
3031
"github.com/sirupsen/logrus"
3132
)
3233

@@ -56,10 +57,13 @@ func NeedsUserXAttr(d string) (bool, error) {
5657
return false, nil
5758
}
5859

59-
// TODO: add fast path for kernel >= 5.11 .
60+
// Fast path for kernel >= 5.11 .
6061
//
6162
// Keep in mind that distro vendors might be going to backport the patch to older kernels.
62-
// So we can't completely remove the check.
63+
// So we can't completely remove the "slow path".
64+
if kernel.CheckKernelVersion(5, 11, 0) {
65+
return true, nil
66+
}
6367

6468
tdRoot := filepath.Join(d, "userxattr-check")
6569
if err := os.RemoveAll(tdRoot); err != nil {

0 commit comments

Comments
 (0)