On Wed, 7 Nov 2018 15:57:04 -0800 Jeremy Allison via samba <samba at lists.samba.org> wrote:> On Thu, Nov 08, 2018 at 02:34:50AM +0300, Albert Berger via samba > wrote: > > On Thu, Nov 08, 2018 at 06:12:40AM +1300, Andrew Bartlett wrote: > > > On Wed, 2018-11-07 at 15:19 +0300, Albert Berger via samba wrote: > > > > > > > > I tried in sequence to start Samba in following conditions: > > > > > > > > 1. With all clients disconnected from Samba server; > > > > 2. As above + all shares disabled; > > > > 3. As above + minimal smb.conf > > > > 4. With totally empty smb.conf. > > > > > > > > In all cases those every-60-seconds writes persist. > > > > What else can be done in this situation? Can it be > > > > that some Debian/Raspbian patch causes this behaviour? > > > > Should I try to compile Samba from upstream? > > > > > > You haven't said what version you are running. > > > > > > But in general, there are essentially no specific Debian patches, > > > we work hard to keep those packages as upstream as possible, so > > > unless Raspbian has done something really odd (unlikely) there > > > isn't any point going upstream. > > > > > > Andrew Bartlett > > > -- > > > Andrew Bartlett http://samba.org/~abartlet/ > > > Authentication Developer, Samba Team http://samba.org > > > Samba Developer, Catalyst IT > > > http://catalyst.net.nz/services/samba > > > > > > > Well, I mentioned that the output of "smbd --version" is > > "4.2.14-Debian". Is this the package version? In Samba's source > > code there are mentions of "housekeeping" activity: in the file > > process.c one can search for SMBD_HOUSEKEEPING_INTERVAL and > > 'housekeeping_fn' which among other things performs some operations > > with log files. Can this be the explanation? > > SMBD_HOUSEKEEPING_INTERVAL is 60 seconds, and run on a tevent > timer event, and it implements: > > * > * Do the recurring log file and smb.conf reload checks. > */ > > static bool housekeeping_fn(const struct timeval *now, void > *private_data) { > struct smbd_server_connection *sconn = talloc_get_type_abort( > private_data, struct smbd_server_connection); > > DEBUG(5, ("housekeeping\n")); > > change_to_root_user(); > > /* update printer queue caches if necessary */ > update_monitored_printq_cache(sconn->msg_ctx); > > /* check if we need to reload services */ > check_reload(sconn, time_mono(NULL)); > > /* > * Force a log file check. > */ > force_check_log_size(); > check_log_size(); > return true; > } > > so yes it's goint to look at smb.conf and check_log_size() > will do an fstat() on the open log file descriptor, so this > may explain it. >Yes, but it isn't doing a read, it is trying to do a write and then being cancelled. I have left 'pidstat' running overnight and there is no mention of 'smbd' in the output anywhere. If the OP is using 4.2-14, he is using Raspbian Jessie, I have advised the OP to upgrade to the latest Raspbian, this will get Samba 4.5.x Rowland
On Thu, 2018-11-08 at 08:48 +0000, Rowland Penny via samba wrote:> > Yes, but it isn't doing a read, it is trying to do a write and then > being cancelled.Rowland, Can you point us as the evidence that leads you to that conclusion? I think you are extrapolating too much from an smb.conf line, even when serving read only shares, there are a lot of things in Samba that can case both reads and writes. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
On Thu, 08 Nov 2018 22:08:51 +1300 Andrew Bartlett <abartlet at samba.org> wrote:> On Thu, 2018-11-08 at 08:48 +0000, Rowland Penny via samba wrote: > > > > Yes, but it isn't doing a read, it is trying to do a write and then > > being cancelled. > > Rowland, > > Can you point us as the evidence that leads you to that conclusion?OK, the OP posted lines like these: 04:11:08 AM UID PID kB_rd/s kB_wr/s kB_ccwr/s iodelay Command 04:11:28 AM 0 832 0.00 0.20 0.20 0 /usr/sbin/smbd -D And from 'man pidstat' kB_rd/s Number of kilobytes the task has caused to be read from disk per second. kB_wr/s Number of kilobytes the task has caused, or shall cause to be written to disk per second. kB_ccwr/s Number of kilobytes whose writing to disk has been cancelled by the task. This may occur when the task truncates some dirty pagecache. In this case, some IO which another task has been accounted for will not be happening. kB_rd/s is 0.00 kB_wr/s and kB_ccwr/s are both 0.20 So, from my reading, nothing is being read, but something is trying to write, but being cancelled. I could of course be totally wrong, but if I am the 'pidstat' manpage needs rewriting.> > I think you are extrapolating too much from an smb.conf line, even > when serving read only shares, there are a lot of things in Samba > that can case both reads and writes.Not really extrapolating anything from smb.conf, I only pointed out that 'read only = no' and 'writable = no' are exact opposites of each other and shouldn't be in the same share together, or do you disagree ? Rowland
On Thu, Nov 08, 2018 at 08:48:53AM +0000, Rowland Penny via samba wrote:> On Wed, 7 Nov 2018 15:57:04 -0800 > Jeremy Allison via samba <samba at lists.samba.org> wrote: > > > so yes it's goint to look at smb.conf and check_log_size() > > will do an fstat() on the open log file descriptor, so this > > may explain it. > > > > Yes, but it isn't doing a read, it is trying to do a write and then > being cancelled. > I have left 'pidstat' running overnight and there is no mention of > 'smbd' in the output anywhere. > > If the OP is using 4.2-14, he is using Raspbian Jessie, I have advised > the OP to upgrade to the latest Raspbian, this will get Samba 4.5.x > > Rowland >Can't it be writing to inode with updated access time after reading the file or calling stat function? If atimes are not enabled on your machine this accounts for your not observing HDD writes. If this is the case, if there is a simple mechanism to turn off the 'housekeeping' or change the housekeeping interval? /Al