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

Ralph Böhme slow at samba.org
Fri Mar 3 08:18:38 UTC 2017


On Fri, Mar 03, 2017 at 08:34:15AM +0100, Stefan Metzmacher wrote:
> Am 02.03.2017 um 22:39 schrieb Ralph Böhme:
> > On Thu, Mar 02, 2017 at 01:23:50PM -0800, Jeremy Allison wrote:
> >> 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.
> > 
> > Something like the attached should work to reproduce it. Untested, but you get
> > the idea.
> 
> You would also have to pass '1' instead of e->count to writev()
> otherwise you'll just remove some bytes in the middle
> and resend some bytes at the end.

indeed. :)

Cheerio!
-slow



More information about the samba-technical mailing list