[PATCHES] Fix smbd open race and render defer_open test less flakey
Michael Adam
obnox at samba.org
Thu Sep 11 10:04:54 MDT 2014
On 2014-09-10 at 10:21 -0700, Jeremy Allison wrote:
> On Wed, Sep 10, 2014 at 01:57:44PM +0200, Michael Adam wrote:
> >
> > The first is due to a race in open_file() which I
> > fixed in the other attached patch: The file vanished
> > between check for existence and the acl check.
> > ==> review/push/comments appreciated.
>
> Great catch Michael
Gosh! After anoter > 1600 runs, defer_open failed for me again
and showed that the patch may have been too short-sighted:
In open_file_ntcreate() we do this:
file_existed = smb_fname->st;
...
open_file(...);
...
if (file_existed &&
!check_same_dev_ino(&saved_stat, &smb_fname->st))
{
close;
fail with NT_STATUS_ACCESS_DENIED;
}
So I nicely fixed open_file, but the caller stumbles. ;-)
What about the attached patch which only fails the open
if it was not us who did the re-create?
Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-open-if-we-recreated-a-file-that-vanished-af.patch
Type: text/x-diff
Size: 997 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140911/ed15e940/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140911/ed15e940/attachment.pgp>
More information about the samba-technical
mailing list