SMB2/3 Performance

David Disseldorp ddiss at suse.de
Fri Nov 22 05:55:55 MST 2013


Nice work Metze! One comment so far...

On Wed, 20 Nov 2013 17:49:09 +0100
"Stefan (metze) Metzmacher" <metze at samba.org> wrote:

>  		/* Recvfile error. Drain incoming socket. */
>  		size_t ret = drain_socket(req->sconn->sock, unread_bytes);
>  		if (ret != unread_bytes) {
> -			smbd_server_connection_terminate(req->sconn,
> -				"Failed to drain SMB2 socket\n");
> +			int saved_errno = errno;
> +			DEBUG(2, ("Failed to drain SMB2 socket:\n"));
> +			return map_nt_error_from_unix_common(saved_errno);

It's not clear whether errno will be non-zero if (ret != unread_bytes),
particularly as none of the other drain_socket() callers use errno.
I'd prefer an explicit NT_STATUS_UNSUCCESSFUL return, or similar.

Might as well drop the trailing ":" from the DEBUG string while you're
there too.

Cheers, David


More information about the samba-technical mailing list