Samba 4.x package support thread

mhh seems something changed, compared to the last time i created the waf-answer files, will investigate this.

@panda-mute I need your diffconfig and target/subtarget and what sdk you compile against. I cant reproduce this, i get:

Checking for a 64-bit host to support lmdb: NO
Checking errno of iconv for illegal multibyte sequence: OK
Checking for kernel change notify support: OK
Checking for Linux kernel oplocks: OK
Checking for kernel share modes: OK
Checking if can we convert from CP850 to UCS-2LE: OK
Checking if can we convert from UTF-8 to UCS-2LE: OK

PS: For my extra freed, the cross-execute based locally created cross-answer.txt is now also included with the package in /etc/samba. This should help check basic configuration errors or notice differences from default cross-answers.

Ok, now running the latest release and this one works fine! nice :slight_smile:
only thing that needed some fiddling with was the avahi service which for some reason didn't start on startup, and made the shares invisible for the mac. Guess that is some sort of quirck in my config.

I use the openwrt master branch with the latest source code compile, and switch libc from musl to glibc.
Please check the openwrt config and cross answer.txt from the following link. Thanks!
https://drive.google.com/open?id=1dGePnoKnR9v9DQN_h2oVmrk38RMe1jSc

The interesting thing is when use the code in your repo(openwrt-extra), the issue is gone!

What answers you get with stock musl config?

Mhh you use the qemu option for the extra freed build or stock answer files?

PS: When did you test my extra repo, since i just (today) updated to 4.9.5, so maybe there was a fix?

@Andy2244, you have my report about the same situation in LInksys WRT thread about 4 months ago. I also have half-reading speeds at my WRT3200. Still exist.

However, new bug comes - seems like sometimes samba lock the files - if it was created by it, you don't overwrite it until restart. It's started somewhere in January and still exist.

@diizzy SATA provides more stable rates and consumes less CPU for me. However, it
s the only option for good SSD.

Try 4.9.5 from extra, i think there was something about lockfiles in the changelog.

PS: If you don't need vfs modules, you can try cifsd as samba alternative, but be aware that it has no wsdd2 support yet, so you need to use manual network paths + mount.

Hi Andy2244.

For some time now I have not interacted in this forum. To better understand Samba 4, I had to step back.
I decided to install first on Ubuntu 18.04. I've had so many problems with configuring the network interface and interacting with Samba4 that I've been taking steps back, trying Ubuntu 18.10, Debian 9, FreeBSD 11, and CentOS 7 right now. What do I have to say about this , is that I'm impressed with what they've done with the network configuration and the number of bugs that have been open and unsolved for a long time. I ended up in CentOS because it is more stable and understandable in network configuration. PS. I do not use Graphical interface nor network manager.
Well. I have reached a point that I have a functional AD / DC in CentOS7 but I have been facing a lot of doubts regarding DNS.
What leads me to interact here, is to ask if anyone knows a good forum about Samba4. The impression I have, is that the developers of Samba 4 do not want to discuss the subject, and everything always points to the Wiki itself which also can not speak very well. A lot of things with no clear explanation and contradictory and discontinuous articles in many points, causing more doubts than explanations. The Nabble forum is very poor as well, have gotten very bad and with no security at all with login without https (I used it a long time ago with Horde and was a very good forum).
I'm going back to samba on OpenWRT as soon as I'm safe on CenTOS.
Thanks for any help.

Hi guys!

I am finishing my tiny NAS based on MQMaker WiTi board, and I've found a bug in samba 4.9.4 currently included into OpenWRT distribution

On copying certain files (about each 100th file, usually files with spaces and dashes in file name) I the copy error (file write error, I have to skip it) and the following does to syslog on OpenWRT:

Fri Mar 29 11:02:45 2019 daemon.err smbd[3635]: [2019/03/29 11:02:45.743125,  0] ../source3/smbd/dfree.c:125(sys_disk_free)
Fri Mar 29 11:02:45 2019 daemon.err smbd[3635]:   sys_disk_free: VFS disk_free failed. Error was : Not a directory

There is a similar bug discovered in FreeNAS: https://redmine.ixsystems.com/issues/33351

Are there any plane to patch that issue and/or to upgrade Samba to 4.9.5?
Or any other ways to handle it?

P.S. Samba3 solves the issue, but it is twice slower in my setup (17-20 Mb/s write instead of 37-42) and incurs higher CPU load. MT7621 is indeed quite slow.

The 4.9.5 update should be ready soon, yet i can't find any changelog fix regarding such a issue, so no idea if 4.9.5 will help here.

The freenas fix, seems specific to the vfs_zfs_space module, which we don't ship and build. So no idea what i can do, except keep updating samba to the latest versions.

I also can't find a open bugreport related to this via https://bugzilla.samba.org/, so you might setup one there.

PS: What VFS modules are you using?

Thanks for prompt reply!

Initially I didn't change anything in the config from OpenWRT feed.
The module list seems to be
auth_builtin, auth_sam, auth_unix, auth_script, pdb_smbpasswd, pdb_tdbsam, vfs_default, vfs_fruit, vfs_shadow_copy2, vfs_recycle, vfs_fake_perms, vfs_readonly, vfs_cap, vfs_offline, vfs_crossrename, vfs_catia, vfs_streams_xattr, vfs_xattr_tdb, vfs_virusfilter, vfs_shell_snap, vfs_commit, vfs_worm, vfs_aio_fork, vfs_aio_pthread, vfs_netatalk, vfs_dirsort, vfs_fileid, vfs_posixacl, vfs_acl_xattr, vfs_acl_tdb
Indeed that's simply Samba4 + VFS + Avahi discovery enabled from menuconfig, I did not get much into the code yet.

I have already written than 4.9.5 should work fine as it does on out university server with Ubuntu, but then have checked the version there - it's 4.3.11 :grinning:

Is there any relatively simple way to build custom package version (e.g. older Samba 4.3.11)?

Not really, this version is so old, that a simple version source change in the makefile wont work.

Are you actually using any VFS modules via luci or the macOS option? By default no VFS module is used, unless you specify one in the config or use the macOS option.

PS: If you just want a simple/fast fileshare, i also work on the cifsd package that's an alternative to samba, but the PR still needs some work before it will be merged. Its in my extra feed for testing, if you want to try it.

I see.
VFS are used as I enabled discovery through Avahi, let me try disabling it.
Thanks for the idea about CIFS, I'll try it out.

Indeed I have built samba 4.9.5, and the problem remained. I don't know what's the reason and how to fix, but if I find it, I'll post the link to patch/fix here

Dear Andy,

with VFS plugins disabled both Samba 4.9.4 and 4.9.5 work perfectly fine!
Thus, the workaround to repeat the issue is quite complex (build OpenWRT image with samba4 + vfs + avahi support, enable macOS compatible shares, and only certain files failed to be copied - as I checked, based on their content, not names: renaming did not help).
Seems that was my fault trying to enable multiple new options at once.

Thank you for all maintenance work!

The macOS option is fairly new and i do not recommend enabling this option if you don't really need it. So only enable this, if you mainly work with macOS. It adds some VFS modules that allow macOS, Timemachine to work, but this happens globally so you add some VFS layers for all clients/shares.
Thats a limitation currently, since samba has no way of enabling macOS compatibility just for specific shares, so side effects may happen like the one you encountered.

when 4.9.5 will be pushed to maser openwrt?

Soon, its bundled with a other bigger change so takes a bit longer to test.

I'm update firmware, so now i have Samba 4.9.6-1

  • Low read speed across wifi connection still in place (i have 7MB/s read, 30(!)MB/s write, iperf shows 350Mbps throughput)
  • Files are still locked after first write.
  • Now it's a LOT of complains in log about master browser if Netbios enabled - seems like nnpd broken completely.

Resume. No progress for me last 5 months, new issues only. %-(

Not much i can do about it, i'm not a expert on why wifi reads are so slow for your configuration. All i can test and fiddle with are samba parameters that may impact this and as noted we use a pretty standard, default configuration out of the box, that also ships with most other distros. The speeds via cable seem fine for me, its around the max. 100MB/s. Unless i get more reports on those issues and can reproduce them, unfortunately i have to assume they are a local problem with your setup + config.

If you have a issue with netbios spam, just open a issue i can track and see whats going on there.

PS: Not sure what you mean about "locked after first write" ?

@Andy2244, I don't expect you have a silver bullet for this, but will appreciate if you give me some hints for deep investigation - seems like this issue is not only belong to me.

Using the same settings, i have around 100MB at wires too, so the problem is definitely in wi-fi as a transport. By the way, not only iperf, but sftp as well works fine (30MB/s read) using the same box and PC position.

I reset the settings to default, but it's provide even more performance degradation, both read and write.

Do you have any ideas where to look/debug this issue?

PS: PC app creates a file - write file - close file. Trying to open and write again after some time - file is r/o. I use ext4 on NAS HDD, access rights are correct for this file, but it can't be opened for write again (but can be read or removed). Samba restart helps, so seems like Samba keeps it opened for writing even after session ends.