I added one testshare /home/testijako and connected to it with the same
credentials as I would connect to ZFS-shares. Then I did the strace to
that particular PID and tried connecting to one ZFS-share. There was
indeed an error which might have something to do with this issue:
Line 2001: lstat("/tank/rex", 0x7fff1f6fb2c0) = -1 ENOENT (No
such
file or directory)
Im sure that folder exists (files have been omitted):
aurinko at punishedkorppu:~$ cd /tank/rex
aurinko at punishedkorppu:/tank/rex$ ls -hal
total 32M
drwxrwxrwx 12 rex rex 20 Dec 24 19:09 .
Full stracefile can be found here:
https://pastebin.com/raw/i5BpVPuY
Jeremy Allison via samba kirjoitti 9.1.2018 klo 0:57:> On Mon, Jan 08, 2018 at 11:06:37PM +0200, John Doe via samba wrote:
>> Hi,
>>
>> I am having a really strange problem with my Samba shares on Debian
>> Buster. None of the users can access any shares, which reside on
>> ZFS-filesystem. Any other share works just fine. For example, if I
>> create a normal folder to /home with same permissions and replace a
>> ZFS-share with that, it works fine.
>>
>> When accessing any ZFS-shares the following error is recorded:
>> Jan 08 22:39:56 punishedkorppu smbd[27893]: [2018/01/08
22:39:56.075343,
>> 0] ../source3/smbd/service.c:774(make_connection_snum)
>> Jan 08 22:39:56 punishedkorppu smbd[27893]: canonicalize_connect_path
>> failed for service rex, path /tank/rex
>>
>> The system in use is Debian Buster with Samba 2:4.7.3+dfsg-1 and ZoL
>> 0.7.4-1 from Debian repo. Selinux is disabled and apparmor too.
>>
>> Any ideas what might be wrong with this setup?
>
> Do an strace. canonicalize_connect_path() is a very simple
> function, but my guess is the call to SMB_VFS_REALPATH()
> is failing for some reason on your ZFS filesystem.
>
On Tue, Jan 09, 2018 at 07:57:41AM +0200, John Doe via samba wrote:> I added one testshare /home/testijako and connected to it with the same > credentials as I would connect to ZFS-shares. Then I did the strace to > that particular PID and tried connecting to one ZFS-share. There was > indeed an error which might have something to do with this issue: > > Line 2001: lstat("/tank/rex", 0x7fff1f6fb2c0) = -1 ENOENT (No such > file or directory) > > Im sure that folder exists (files have been omitted): > aurinko at punishedkorppu:~$ cd /tank/rex > aurinko at punishedkorppu:/tank/rex$ ls -hal > total 32M > drwxrwxrwx 12 rex rex 20 Dec 24 19:09 .Well that looks like your issue. You need to figure out why lstat("/tank/rex") is failing on an existing directory.
I just noticed that by running by commands /usr/sbin/smbd -D or /usr/sbin/smbd -i without systemd's unit, all shares work perfectly so the problem must then be somehow related to systemd.. Let the testing continue.. I also tested what happens if I comment out everything and just use ExecStart=/usr/sbin/smbd -D as that command worked on the console. That did not help. For the record, this is the default unit-file: [Unit] Description=Samba SMB Daemon Documentation=man:smbd(8) man:samba(7) man:smb.conf(5) After=network.target nmbd.service winbind.service [Service] Type=notify NotifyAccess=all PIDFile=/var/run/samba/smbd.pid LimitNOFILE=16384 EnvironmentFile=-/etc/default/samba ExecStart=/usr/sbin/smbd $SMBDOPTIONS ExecReload=/bin/kill -HUP $MAINPID LimitCORE=infinity [Install] WantedBy=multi-user.target Jeremy Allison via samba kirjoitti 9.1.2018 klo 21:47:> On Tue, Jan 09, 2018 at 07:57:41AM +0200, John Doe via samba wrote: >> I added one testshare /home/testijako and connected to it with the same >> credentials as I would connect to ZFS-shares. Then I did the strace to >> that particular PID and tried connecting to one ZFS-share. There was >> indeed an error which might have something to do with this issue: >> >> Line 2001: lstat("/tank/rex", 0x7fff1f6fb2c0) = -1 ENOENT (No such >> file or directory) >> >> Im sure that folder exists (files have been omitted): >> aurinko at punishedkorppu:~$ cd /tank/rex >> aurinko at punishedkorppu:/tank/rex$ ls -hal >> total 32M >> drwxrwxrwx 12 rex rex 20 Dec 24 19:09 . > > Well that looks like your issue. You need to figure > out why lstat("/tank/rex") is failing on an existing > directory. >