Bug 1091442 - Can not properly use SUSE Samba-Share as lowerdir for an overlay
Can not properly use SUSE Samba-Share as lowerdir for an overlay
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Samba
Current
x86-64 SUSE Other
: P5 - None : Normal (vote)
: ---
Assigned To: The 'Opening Windows to a Wider World' guys
The 'Opening Windows to a Wider World' guys
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-30 15:38 UTC by Seiji Hiwatari
Modified: 2018-08-29 15:59 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seiji Hiwatari 2018-04-30 15:38:38 UTC
When openSUSE Tumbleweed is used to host a samba share, and that share is used as lowerdir for a overlay filesystem - files in the lowerdir can not be modified - no matter the user (even root). Creating new files that do not exist in the lowerdir works as expected.

Here are the steps to reproduce. For a very simple setup, we installed a new virtual machine with openSUSE Tumbleweed and tested soleily on that. The original setup consisted of multiple machines, which didn't work either. All following commands are done as user root.

1. create samba share (with yast2, everything else on default settings) resulting in:

[BASE]
inherit acls = yes
path = /mnt/base
read only = No
force group = users
force user = testuser
guest ok = Yes

2. create file in samba share:

echo "foo" > /mnt/base/foo.txt

3. mount samba share:

mkdir /tmp/lower
mount //localhost/BASE -ouid=1000,gid=1000,guest /tmp/lower

4. create overlay fs:

mkdir /tmp/{upper,work,overlay}
mount -t overlay overlay -olowerdir=/tmp/lower,upperdir=/tmp/upper,workdir=/tmp/work /tmp/overlay

5. try to modify foo.txt in /tmp/overlay

nano foo.txt

>> [File 'foo.txt' is unwriteable ] <<


Even user root does not have the ability to modify (overwrite) a file from the lowerdir into the upperdir, so this does not seem to be a permission problem. Creating new files works just fine. We tested a couple of combinations:
- Gentoo server hosting the share, gentoo system mounting the share - works
- suse server hosting the share, gentoo system mounting the share - doesn't work
- Gentoo server hosting the share, suse client mounting the share - works
- suse server hosting the share, suse client mounting the share - doesn't work

So this seems to be a samba problem in openSUSE.
Comment 1 Paulo Alcantara 2018-05-07 12:38:59 UTC
Hi,

We were able to reproduce the same issue and it seems to not be related to overlayfs, but a bug in cifs' listxattr() implementation. A patch [0] that should fix your issue has been set upstream and got merged recently.

As long as we don't get it to TW, I've created a repo with the patch applied on top of it that you might want to test:

# zypper ar http://download.opensuse.org/repositories/home:/pauloac:/kernel-source-bsc1091442/standard/
# zypper in -f kernel-default
# reboot

Thanks,
Paulo

[0] - http://marc.info/?i=20180504142526.9504-1-palcantara@suse.de
Comment 2 Seiji Hiwatari 2018-05-12 14:25:16 UTC
Everything works as expected now. Thank you very much!
Comment 3 James McDonough 2018-08-29 15:59:13 UTC
fix shipped in tumbleweed, closing