[Samba] The connection would be broken when read rate is too big

Jeremy Allison jra at samba.org
Thu Mar 2 21:23:50 UTC 2017


On Thu, Mar 02, 2017 at 11:03:50AM +0100, Ralph Böhme wrote:
> On Wed, Mar 01, 2017 at 05:12:23PM -0800, Jeremy Allison wrote:
> > On Wed, Mar 01, 2017 at 04:29:49PM -0800, Jeremy Allison wrote:
> > > On Wed, Mar 01, 2017 at 08:31:32AM +0000, Chenyehua via samba wrote:
> > > > I don’t know why the fd is marked to readable when the send queue is more than the max.
> > > > Or why mark the fd readable but not allocate memory to the state->req.
> > > > 
> > > > My solution: Allocate memory to the state->req before return when the send
> > > > queue is more than the max in smbd_smb2_request_next_incoming function.
> > > > 
> > > > Could you give us some help about the problem.
> > > 
> > > I'm looking at this now. Your report looks correct.
> > > Can you log a bug at bugzilla.samba.org so we can
> > > track this ?
> > 
> > Can you try the following (raw and untested) patch ?
> 
> Fwiw, I looked into this as well and came to the same conclusion.

Here's the official patch to the bug I logged:

https://bugzilla.samba.org/show_bug.cgi?id=12608

I managed to reproduce locally by
setting aio read size = 1 and then mangling smbd_smb2_request_next_incoming()
to block any reads if there were any outgoing entries
in the queue - but it wasn't reliably reproducible or easily
tested. If you can think of a good way to add a reliable
regression test I'd be happy to review, but I think the
patch is good on its own.

Please review and push if happy.

Cheers,

	Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-Restart-reading-the-incoming-SMB2-fd-when-th.patch
Type: text/x-diff
Size: 2075 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170302/21572870/0001-s3-smbd-Restart-reading-the-incoming-SMB2-fd-when-th.diff>


More information about the samba-technical mailing list