From: Changli Gao <xiaosuo@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, mszeredi@suse.cz,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/4] splice: fix updating sd->pos wrongly
Date: Fri, 28 May 2010 19:36:36 +0800 [thread overview]
Message-ID: <AANLkTinBmZej_rQFQ_bMPJf9GGJFFW3zdnpqZTXZCIfc@mail.gmail.com> (raw)
In-Reply-To: <E1OHxTV-0002u1-Vo@pomaz-ex.szeredi.hu>
On Fri, May 28, 2010 at 7:11 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Fri, 28 May 2010, Changli Gao wrote:
>> Before checking the sd->pos, sd->pos
>> already is updated with the value returned by splice_read(), so if in
>> file is seekabble, sd->pos is non-zero when I checking it.
>
> I see the logic now. But it's really confusing, at least some
> comments would be needed.
>
> But I think it would be better not to try reusing sd->pos for reading,
> but supplying an "loff_t *read_ppos" to splice_direct_to_actor and
> leaving sd->pos alone (for the write side to use and update as
> necessary).
>
if (ret < read_len) {
I think is much like a hack too. :)
- sd->pos = prev_pos + ret;
+ if (sd->pos)
+ sd->pos = prev_pos + ret;
goto out_release;
}
Anyway, it can fix the issue I mentioned above. Any future cleanup
should not be mixed in, IMO.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
next prev parent reply other threads:[~2010-05-28 11:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-05-28 11:40 ` Miklos Szeredi
2010-05-29 14:09 ` Jamie Lokier
2010-05-29 14:22 ` Changli Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinBmZej_rQFQ_bMPJf9GGJFFW3zdnpqZTXZCIfc@mail.gmail.com \
--to=xiaosuo@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@suse.cz \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).