splice: direct splicing updates ppos twice
[sfrench/cifs-2.6.git] / fs / splice.c
index 6c9828651e6f5cdec78ce99d5169bb238c61f0ea..53fc2082a4681fdc311adcf0596f11fb6d45a8c5 100644 (file)
@@ -1061,8 +1061,9 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 
        while (len) {
                size_t read_len;
+               loff_t pos = sd->pos;
 
-               ret = do_splice_to(in, &sd->pos, pipe, len, flags);
+               ret = do_splice_to(in, &pos, pipe, len, flags);
                if (unlikely(ret <= 0))
                        goto out_release;
 
@@ -1080,6 +1081,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 
                bytes += ret;
                len -= ret;
+               sd->pos = pos;
 
                if (ret < read_len)
                        goto out_release;