login
Header Space

 
 

Re: [regression?] distcc says: (dcc_pump_sendfile) ERROR: sendfile returned 0? can't cope (bisected)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jens Axboe <jens.axboe@...>
Cc: Dan Williams <dan.j.williams@...>, linux-kernel <linux-kernel@...>
Date: Thursday, May 8, 2008 - 3:21 am

On Wed, 2008-05-07 at 23:16 +0200, Jens Axboe wrote:

I did, and it still looks ok to me, but obviously it's not, so I'll have
to do some more digging.

The only thing I can think of right now that might be a possible cause
would be in splice_direct_to_actor(), if we had an incomplete transfer,
the sd->pos returned and assigned would have the value set by the failed
actor().  Maybe something like the following would take care of that
case, but I haven't had a chance to test it yet - will do that tomorrow
night...

Tom

diff --git a/fs/splice.c b/fs/splice.c
index 633f58e..1bb3f34 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -986,7 +986,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 
 	while (len) {
 		size_t read_len;
-		loff_t pos = sd->pos;
+		loff_t pos = sd->pos, prev_pos = pos;
 
 		ret = do_splice_to(in, &pos, pipe, len, flags);
 		if (unlikely(ret <= 0))
@@ -1001,8 +1001,10 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 		 * could get stuck data in the internal pipe:
 		 */
 		ret = actor(pipe, sd);
-		if (unlikely(ret <= 0))
+		if (unlikely(ret <= 0)) {
+			sd->pos = prev_pos;
 			goto out_release;
+		}
 
 		bytes += ret;
 		len -= ret;


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [regression?] distcc says: (dcc_pump_sendfile) ERROR: se..., Tom Zanussi, (Thu May 8, 3:21 am)
speck-geostationary