mkdir-dup test flapping
abartlet at samba.org
Wed Mar 9 05:31:19 UTC 2016
On Tue, 2016-03-08 at 20:54 -0800, Jeremy Allison wrote:
> On Wed, Mar 09, 2016 at 04:11:05PM +1300, Douglas Bagnall wrote:
> > We looked at this some more, and Andrew seemed to understand and
> > wrote
> > the attached patch.
> > We need to decide if the change in owner is enough reason to refuse
> > the open(), or if we should just continue.
> > On the basis that the owner change is not significant, we reworked
> > the
> > code to do the lstat() after the fstat(), and not compare the
> > owner.
> Fix is really close, but still needs a little work -
> the call to:
> fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_dname->st);
> needs to be moved too (as in the race condition
> when need_lstat is true smb_dname->st isn't correctly
> initialized yet), or the lstat needs to be done both
> before and after. Doing the lstat twice might be
> safer as I'll need to check what uses fsp->file_id
> to ensure moving to after the lstat is safe.
> *Really* nice work though - thanks ! It's late
> here now so I'll take a look at this first thing
> in thr morning (US Pacific time) and post an
> updated patch for you to look at tomorrow.
Thank you very much. We figured that if we made a first attempt, a
fixed up patch wouldn't be far behind :-)
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
More information about the samba-technical