[PATCHES] Issue fsync for SMB2 FLUSH asynchronously

Jeremy Allison jra at samba.org
Thu Nov 12 02:05:57 UTC 2015

On Wed, Nov 11, 2015 at 03:21:13PM -0800, Jeremy Allison wrote:
> Hmmm. In test I'm getting
> [180(681)/1881 at 31m13s] samba3.smbtorture_s3.plain(nt4_dc).SMB2-BASIC
> UNEXPECTED(failure): samba3.smbtorture_s3.plain(nt4_dc).SMB2-BASIC.smbtorture(nt4_dc)
> REASON: Exception: Exception: using seed 1447283296
> host= share=tmp user=jra myname=localnt4dc2
> Running SMB2-BASIC
> Starting SMB2-BASIC
> smb2cli_flush returned NT_STATUS_IO_TIMEOUT
> Let me look at this some more..

Found the bug. It's my fault of old..

There is a *HIDEOUS* global variable that counts
the number of outstanding aio calls:

extern int outstanding_aio_calls;

and when source3/modules/vfs_default.c
wants to read the results of an async
call in vfswrap_asys_finished() it
uses a variable length array defined

struct asys_result results[outstanding_aio_calls];

ret = asys_results(asys_ctx, results, outstanding_aio_calls);

to work out how many to read. The vfswrap_fsync_send()
doesn't increment outstanding_aio_calls so when
the fflush finishes it calls asys_results(asys_ctx, results, 0);
which doesn't work too well :-).

I need to ensure outstanding_aio_calls is kept up
to date everywhere.

Going to clock off now - I'll post a fixed
patch (that passes make test) tomorrow.

Sorry for the problem !


More information about the samba-technical mailing list