Skip to content

Commit

Permalink
Merge pull request #948 from giuseppe/fix-check-for-rootless-native-diff
Browse files Browse the repository at this point in the history
overlay: fix check for rootless native diff
  • Loading branch information
vrothberg authored Jun 22, 2021
2 parents b83d218 + 1e81ec1 commit af17ac5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/overlay/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ func doesSupportNativeDiff(d, mountOpts string) error {
return errors.Wrap(err, "failed to set opaque flag on middle layer")
}

opts := fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", path.Join(td, "l2"), path.Join(td, "l1"), path.Join(td, "l3"), path.Join(td, "work"))
mountFlags := "lowerdir=%s:%s,upperdir=%s,workdir=%s"
if unshare.IsRootless() {
mountFlags = mountFlags + ",userxattr"
}

opts := fmt.Sprintf(mountFlags, path.Join(td, "l2"), path.Join(td, "l1"), path.Join(td, "l3"), path.Join(td, "work"))
flags, data := mount.ParseOptions(mountOpts)
if data != "" {
opts = fmt.Sprintf("%s,%s", opts, data)
Expand Down

0 comments on commit af17ac5

Please sign in to comment.