linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 4/4] splice: fix updating sd->pos wrongly
@ 2010-05-26 14:44 Changli Gao
  2010-05-28  9:42 ` Miklos Szeredi
  0 siblings, 1 reply; 10+ messages in thread
From: Changli Gao @ 2010-05-26 14:44 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Alexander Viro, Miklos Szeredi, linux-fsdevel, linux-kernel,
	Changli Gao

fix updating sd->pos wrongly.

In error path, we don't need to updating sd->pos, if the file isn't seekable.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
 fs/splice.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/splice.c b/fs/splice.c
index 57172ca..c69b241 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1185,7 +1185,8 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 		sd->pos = pos;
 
 		if (ret < read_len) {
-			sd->pos = prev_pos + ret;
+			if (sd->pos)
+				sd->pos = prev_pos + ret;
 			goto out_release;
 		}
 	}

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-05-29 14:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 14:44 [PATCH v2 4/4] splice: fix updating sd->pos wrongly Changli Gao
2010-05-28  9:42 ` Miklos Szeredi
2010-05-28 10:00   ` Changli Gao
2010-05-28 10:13     ` Miklos Szeredi
2010-05-28 10:55       ` Changli Gao
2010-05-28 11:11         ` Miklos Szeredi
2010-05-28 11:36           ` Changli Gao
2010-05-28 11:40             ` Miklos Szeredi
2010-05-29 14:09         ` Jamie Lokier
2010-05-29 14:22           ` Changli Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).