For SMB2 we set the socket to non-blocking, the low-level sendfile code doesn't cope well with this (it just loops on EAGAIN). Reported on samba-technical by Vadim Lazovskiy <vadim.lazovskiy@gmail.com>.
Created attachment 14327 [details] git-am fix for master. Possible patch for master. Needs confirmation from reporter.
Created attachment 14329 [details] git-am fix proposed for master. Updated with code to only change/restore socket state on EAGAIN/EWOULDBLOCK returns.
Reporter confirmed fix addresses his problem.
Created attachment 14330 [details] git-am fix for 4.9.rcNext, 4.8.next, 4.7.next. Cherry-picked from master. Applies cleanly to 4.7.next, 4.8.next, 4.9.rcNext.
Karolin please apply to the relevant branches. Thanks !
(In reply to Jeremy Allison from comment #5) Pushed to autobuild-v4-{9,8,7}-test.
(In reply to Karolin Seeger from comment #6) Pushed to all branches. Closing out bug report. Thanks!