Hi everybody!
I have a QNAP at home running firmware 4.4.2.1273 and I have configured it
with NFS (for my iMac and FireTV) and SMB access (standalone server, for
Win10 and iPhone/iPad Files access)
Everything went fine till a certain point where many application would crash
or behave in a very strange way when accessing SAMBA shares. Application can
be Explorer++, OneCommander or File.app from my iPhone.
What I saw, after a long debugging session, is that these apps send tons of
Change Notifications requests
smbd_smb2_notify_send: notify change called on ., filter
FILE_NAME|DIR_NAME|ATTRIBUTES|CREATION|SECURITY|STREAM_SIZE|STREAM_WRITE,
recursive = 0
[2020/05/01 01:32:03.255113, 3]
../source3/smbd/smb2_notify.c:253(smbd_smb2_notify_send)
They send around 34 requests per second and the server replies to all of
them. This creates lots of issues (some programs hang, other crashes, others
show flashing folders). The default behaviour for the server is to wait for
1 minute before answering back, but this is not happening.
What I did was changing the /etc/smb.conf and added
change notify = no
So that the samba server will just ignore those changes. This also means
that if there is a file change, I may not see it unless I manually refresh
the directory tree.
After I restarted samba, I could succesfully use OneCommander, and also
Files.
Windows Explorer does not use this kind of notifications, so this is why it
always worked.
Of course, I do not believe this is the best solution but I cannot
understand what (from the server side) would trigger a client to start
sending so many notification requests. I am writing this because I was
already using Files and OneCommander and everything was working fine. Being
the client the same, something must've happened on the server side.
In the QNAP I did a modification in the shared folders: I ran convmv to
change from UTF8 NFC to UTF8 NFD and, apparently, after this I started to
have some troubles. I moved back to NFC but the problem still persists. I do
not know if this has anything to do; it may also be that I restarted the
QNAP and some configurations that I committed in the past were executed,
though my smb.conf file looks pretty simple.
Any ideas on why this is happening and therefore how to go back to
normality? This is driving me really crazy.
Current samba version is the following
smbd (samba daemon) Version 4.7.12
smbd (samba daemon) is running.
max protocol SMB 3 enabled.
My configuration is the following:
[global]
passdb backend = smbpasswd
workgroup = HOME
security = USER
server string = NAS
encrypt passwords = Yes
username level = 0
map to guest = Never
null passwords = yes
max log size = 100
socket options = TCP_NODELAY SO_KEEPALIVE
os level = 20
preferred master = no
dns proxy = No
smb passwd file=/etc/config/smbpasswd
username map = /etc/config/smbusers
guest account = guest
directory mask = 0777
create mask = 0777
oplocks = yes
locking = yes
disable spoolss = no
load printers = yes
veto files = /.AppleDB/.AppleDouble/.AppleDesktop/:2eDS_Store/Network Trash
Folder/Temporary
Items/TheVolumeSettingsFolder/. at __thumb/. at __desc/:2e*/. at __qini/.Qsync/.
at uplo
ad_cache/.qsync/.qsync_sn/. at qsys/.streams/.digest/
delete veto files = yes
map archive = no
map system = no
map hidden = no
map read only = no
deadtime = 10
restrict anonymous = 2
server role = auto
use sendfile = yes
unix extensions = no
store dos attributes = yes
client ntlmv2 auth = yes
dos filetime resolution = no
follow symlinks = yes
wide links = yes
force unknown acl user = yes
template homedir = /share/homes/DOMAIN=%D/%U
inherit acls = no
domain logons = no
min receivefile size = 256
case sensitive = auto
domain master = auto
local master = no
enhance acl v1 = yes
remove everyone = no
conn log = yes
kernel oplocks = no
min protocol = SMB2_02
smb2 leases = yes
durable handles = yes
kernel share modes = no
posix locking = no
lock directory = /share/CACHEDEV1_DATA/.samba/lock
state directory = /share/CACHEDEV1_DATA/.samba/state
cache directory = /share/CACHEDEV1_DATA/.samba/cache
printcap cache time = 0
acl allow execute always = yes
server signing = disabled
streams_depot:delete_lost = yes
streams_depot:check_valid = no
fruit:nfs_aces = no
fruit:veto_appledouble = no
winbind expand groups = 1
winbind scan trusted domains = no
pid directory = /var/lock
printcap name = /etc/printcap
printing = cups
show add printer wizard = no
invalid users = guest
dos charset = ISO8859-1
host msdfs = yes
winbind max clients = 2000
winbind max domain connections = 10
log level = 0
log file = /var/log/samba/%m.log
wins support = no
change notify = no
winbind enum groups = Yes
winbind enum users = Yes
vfs objects = shadow_copy2 catia fruit qnap_macea streams_depot
[printers]
use client driver = yes
writable = no
browsable = no
printable = yes
guest ok = yes
path = /var/spool/smb
[Web]
comment = System default share
path = /share/CACHEDEV1_DATA/Web
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest","kodi"
read list = @"nas"
write list = "admin","luca"
valid users =
"root","admin","luca",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/Web/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/Web
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:01:30:19:29:42:65
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[Public]
comment = System default share
path = /share/CACHEDEV1_DATA/Public
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest"
read list = @"everyone",@"nas","_qnap_support"
write list = "luca"
valid users =
"root",@"everyone","luca",@"nas","_qnap_support"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/Public/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/Public
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:01:30:19:29:43:42
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[MotionEyeOS]
comment
path = /share/CACHEDEV1_DATA/MotionEyeOS
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest","kodi"
read list = @"nas"
write list = @"administrators","admin","luca"
valid users =
"root",@"administrators","admin","luca",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/MotionEyeOS/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/MotionEyeOS
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:04:16:01:56:02
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[FILM]
comment
path = /share/CACHEDEV1_DATA/FILM
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest"
read list = @"everyone",@"nas"
write list =
@"administrators","admin","kodi","luca"
valid users
"root",@"administrators","admin","kodi","luca",@"everyone",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/FILM/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/FILM
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:04:16:22:37:65
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[iMac]
comment
path = /share/CACHEDEV1_DATA/iMac
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest"
read list = "kodi",@"everyone",@"nas"
write list =
@"administrators","admin","luca","jenny"
valid users
"root",@"administrators","admin","luca","jenny","kodi",@"everyone",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/iMac/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/iMac
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:04:16:51:58:63
strict allocate = yes
streams_depot:check_valid = yes
mangled names = no
hide unreadable = no
access based share enum = no
[Raspberry]
comment
path = /share/CACHEDEV1_DATA/Raspberry
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest"
read list = @"nas"
write list = @"administrators","admin","luca"
valid users =
"root",@"administrators","admin","luca",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/Raspberry/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/Raspberry
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:04:17:25:58:93
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[Multimedia]
comment = System default share
path = /share/CACHEDEV1_DATA/Multimedia
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest","jenny"
read list = @"everyone"
write list = "admin"
valid users = "root",@"everyone","admin"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/Multimedia/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/Multimedia
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:08:19:15:46:36
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
[Download]
comment = System default share
path = /share/CACHEDEV1_DATA/Download
browsable = yes
oplocks = yes
ftp write only = no
recycle bin = yes
recycle bin administrators only = no
qbox = no
timemachine = no
public = yes
invalid users = "guest"
read list = @"nas"
write list = "admin"
valid users = "root","admin",@"nas"
inherit permissions = yes
shadow:showprevious = yes
shadow:snapdir = /share/CACHEDEV1_DATA/_.share/Download/.snapshot
shadow:basedir = /share/CACHEDEV1_DATA/Download
shadow:sort = desc
shadow:format = @GMT-%Y.%m.%d-%H:%M:%S
smb encrypt = disabled
create time = 2020:02:08:19:15:54:56
strict allocate = yes
streams_depot:check_valid = yes
mangled names = yes
hide unreadable = no
access based share enum = no
Thanks!
Luca