Server: OpenWrt 21.02.2 (Kernel 5.4.179) on a ramips/mt7621 device with samba4-server 4.14.7-1 installed. Share (standard configuration) points to logfiles written by rsyslog. Client: Windows 10 20H2. When my application opens a logfile on the samba-server (access: read, share: RWD) and reads up to its end of file, I would expect that further reads succeed with more data when rsyslog appends more data to the file. This used to work with Samba36. Now the applications never sees new data. Even when I start the app a second time, opening the file a second time, I only see the data up to the point when the file was first opened. Setting oplocks = no on the server solves the problem for me, but It is certainly a hard to trace bug that should be fixed. I don't know whether the problem exists on any linux or just on OpenWrt kernels with their space optimization and possible reduced functions.
Looks like this kernel isn't breaking oplocks when a local process is opening the file. What is the setting for the: kernel oplocks parameter ? If it's set to "no" (the default) then local opens have no effect on Samba oplocks.
Created attachment 17195 [details] smb.conf template used by openwrt This is the config template used by openwrt. Also keep in mind that the order in which the files are opened (client+samba or rsyslog first) is arbitrary. The client keeps the file open until the end of the month and I guess rsyslog as well.