browse.dat file

Jeremy Allison jra at samba.org
Fri May 1 11:00:11 MDT 2015


On Thu, Apr 30, 2015 at 03:50:43PM +0200, Volker Lendecke wrote:
> On Wed, Apr 29, 2015 at 09:19:34PM -0400, rac8006 at aol.com wrote:
> > After doing some investigation.  I've found that about every twelve minutes the process
> > process_local_master_announce procedure.  This procedure also calls update_server_ttl
> > Both of these procedures sets subrec->work_changed to true.  The update_server_ttl 
> > updades the ttl value.  but this value is not stored in the browse.dat file.  Yet it sets the 
> > work_changed to true.   This causes the browse.dat file to be written.  The process local_master _announce
> > procedure either does a create_server or remove_server or updates  the record.  It should
> > write the browse.dat file id it creates or removes data.  But most of the time it is updating
> > the record with the same data that is already in the file.  Why does it have to open a new
> > file.  Write the data.  Close the file. unlink the file.  chmod on the file.  then rename the
> > file to browse.dat.  Every twelve minutes.
> > 
> > The WD MY Cloud NAS  after 10 minutes of no disk writes.  puts the disk in standby mode.
> > Then two minutes of so later it wakes the disk to rewrite the browse.dat file.
> > Why can't the file only be written when it changes.
> 
> Does the attached patch help? I haven't tested it, but from
> your description this might do it.

Ok, I've been following up with rac8006 at aol.com
on this, and I think the correct fix here is to
just remove:

	servrec->subnet->work_changed = True;

from update_server_ttl() as well as from the
functuin below - expire_servers().

The reason is that expire_servers(), which
actually prunes dead server records, calls
remove_server_from_workgroup() which is
the core modification function that sets
work_changed = True;

So the only functions inside source3/nmbd/nmbd_serverlistdb.c
that set work_changed = true should be:

remove_all_servers()
add_server_to_workgroup()
remove_server_from_workgroup()

So I think the change here should be:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-nmbd-Don-t-set-work_changed-True-inside-update_se.patch
Type: text/x-diff
Size: 1857 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150501/1f6cbccd/attachment.patch>


More information about the samba-technical mailing list