nestybox / nestybox/sysbox

CIFS-backed volumes don't work inside a Sysbox container with Shiftfs

Open
#186 14 comments 0 reactions 1 assignee View on GitHub

@ctalledo is already working on this.

Since Feb 24, 2021.

bug
Dominant language
Shell
Stars
3.9k
Forks
230
Avg merge
7h 48m
Merged PRs (30d)
3

Description

I have detected a suspicious behavior around CIFS shares:
I used portainer UI to create the volume with the following options:

type: cifs
device: //127.0.0.1/dev/legacy
o: username=dev,password=dev,vers=3.1.1,uid=1000,gid=1000,cifsacl,mfsymlinks,cache=none

but the problem is reproduced with default configuration too.

If I mount such share are read-only, it works fine, when used by a user with ID 1000 inside the container run via sysbox-runc.
However, when I switch to the read-write mode, I see the following behavior:

  1. Attempt to create a file is successful(for example echo 33 > 42.txt)
  2. Attempt to copy a file from outside of the volume results in File exists
  3. Attempt to copy a file from within the volume results in File exists
  4. As a result of operation above, file is created anyway but has size = 0. When I repeat copy operation, it succeeds(size matches, content too)
  5. The issue is not reproduced if I stop all containers that used the volume via sysbox-runc(to get shiftfs off it) and then attach it to a container ran by casual, default runc

This is likely related to shiftfs but I have no idea how to debug the issue - kernel module seems to have no options whatsoever.

I am on:

 cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

and I used latest release of sysbox, portainer and docker.

Any ideas how to deal with it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.