Skip to content

Regression in V2.2.1 with rootless containers if storage links to different filesystem #10187

@gdoepp

Description

@gdoepp

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug

Description
In version v2.2.1 used in RHEL8, podman does not work anymore for rootless containers if the storage path is a symbolic link to some directory crossing file system boundaries.

Steps to reproduce the issue:

  1. install podman, keep default configuration, the rootless storage path is below the user's home directory

  2. link some directory from a different file system to .local/share/containers/storage

  3. remove .local/share/containers/storage/libpod and run podman info

Describe the results you received:
Error: remount /home/USER/.local/share/containers/storage/overlay, flags: 0x40000: invalid argument

Same with all other subcommands.

Describe the results you expected:
no error

Additional information you deem important (e.g. issue happens only occasionally):
The cause may be a change in vendor/github.com/containers/storage/utils.go:

     @@ -206,11 +206,10 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti

          opts.RunRoot = rootlessRuntime
  -       opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")

     if systemOpts.RootlessStoragePath != "" {
  -               opts.RootlessStoragePath = systemOpts.RootlessStoragePath
  +               opts.GraphRoot = systemOpts.RootlessStoragePath
        } else {
  -              opts.RootlessStoragePath = opts.GraphRoot
  +              opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
     }

    opts.GraphRoot, err = filepath.EvalSymlinks(opts.GraphRoot) // ----- HELPS ---

     if path, err := exec.LookPath("fuse-overlayfs"); err == nil {
             opts.GraphDriverName = "overlay"                                                                                                                                                                                                

The line marked with // ---- HELPS --- makes podman work again.

Output of podman version:

Version:      2.2.1
API Version:  2
Go Version:   go1.14.12
Built:        Sun Feb 21 23:51:35 2021
OS/Arch:      linux/amd64
if link was removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.stale-issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions