فهرست منبع

relay: fix splice problem

Splice isn't always incrementing the ppos correctly, which broke
relay splice.

Signed-off-by: Tom Zanussi <zanussi@comcast.net>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Tom Zanussi 17 سال پیش
والد
کامیت
c3270e577c
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      fs/splice.c
  2. 1 1
      kernel/relay.c

+ 1 - 1
fs/splice.c

@@ -1075,7 +1075,7 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
 
 
 	ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
 	ret = splice_direct_to_actor(in, &sd, direct_splice_actor);
 	if (ret > 0)
 	if (ret > 0)
-		*ppos += ret;
+		*ppos = sd.pos;
 
 
 	return ret;
 	return ret;
 }
 }

+ 1 - 1
kernel/relay.c

@@ -1162,7 +1162,7 @@ static ssize_t relay_file_splice_read(struct file *in,
 	ret = 0;
 	ret = 0;
 	spliced = 0;
 	spliced = 0;
 
 
-	while (len) {
+	while (len && !spliced) {
 		ret = subbuf_splice_actor(in, ppos, pipe, len, flags, &nonpad_ret);
 		ret = subbuf_splice_actor(in, ppos, pipe, len, flags, &nonpad_ret);
 		if (ret < 0)
 		if (ret < 0)
 			break;
 			break;