Chenyehua
2017-Mar-01 08:31 UTC
[Samba] The connection would be broken when read rate is too big
Hi samba-team, I met a problem recently: Problem Description: The connection would be broken when read rate is too big. Environment: Samba 4.3.11 Ubuntu server 14.04 Configuration: usershare allow guests = yes max protocol = SMB3 large readwrite = yes use sendfile = yes aio read size = 1024 oplocks = yes deadtime = 10 aio write behind = true clustering = yes store dos attributes = yes vfs objects = acl_xattr socket options = TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072 ctdbd socket = /var/run/ctdb/ctdbd.socket log level = 2 security = user I add some logs, found when the send queue is more than the max, it won’t allocate memory to the state->req in smbd_smb2_request_next_incoming function. Then, the smbd_smb2_io_handler function mark the fd to not readable because state->req == NULL, and never mark it to readable again. Then the Request Expiration Timer will break the connection. 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. Br Thanks. ------------------------------------------------------------------------------------------------------------------------------------- 本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出 的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、 或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本 邮件! This e-mail and its attachments contain confidential information from H3C, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!