Reported by Andrew Bartlett: > In particular, I'm thinking > > if (total_written < count) { > > is not the correct test for draining the socket. Why does draining the > socket have anything to do with total_written? Shouldn't it be: > > if (count) { > > That is, during a multi-part recvfile of 48k of data (due to the 16k > chunks) I think that we could get a pattern like: > > count = 48000 > total_written = 0 > > nread = 16000 > > end loop 1: > total_written = 16000 > count = 32000 > > error: > total_written is < count > drain 16000 from fromfd, leaving 16000 in fromfd > > or > > start loop 2: > nread = 16000 > total_written = 32000 > count = 16000 > > error: > > total_written is > count > no drain, but 16000 still in fromfd Patch to follow. This is a problem in 3.6.x and also 3.5.x.
Created attachment 7217 [details] git am fix for 3.6.x and 3.5.x.
Comment on attachment 7217 [details] git am fix for 3.6.x and 3.5.x. Canceling this review as the patchset isn't yet complete.
Created attachment 7223 [details] git-am fix for 3.5.x and 3.6.x. Full patch fixing all issues. Has gone into master.
Comment on attachment 7223 [details] git-am fix for 3.5.x and 3.6.x. Tested with the sparc recvfile patch and a full filesystem on 3.5.11
Re-assigning to Karolin for inclusion in 3.5.next and 3.6.next. Jeremy.
Pushed to v3-5-test and v3-6-test. Closing out bug report. Thanks!