Re: [PATCH] splice: fix wrong __splice_from_pipe() usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Axboe <[email protected]> writes:

> On Mon, Jul 16 2007, OGAWA Hirofumi wrote:
>> Hi,
>> 
>> I've noticed the nfsd read corruption by recent change. And this patch
>> fixes the problem for me, is this right fix?
>> -- 
>> OGAWA Hirofumi <[email protected]>
>> 
>> 
>> __splice_from_pipe() is updating the sd->pos for the actor, but those
>> functions are passing the sd of reader side directory. So, splice
>> updates sd->pos twice.
>> 
>> This fixes usage of __splice_from_pipe().
>
> For sendfile() usage, or the nfsd path that uses splice to send?

nfsd_vfs_read() path.

nfsd_vfs_read()
    splice_direct_to_actor()
        while(len) {
            do_splice_to()                     [update sd->pos]
                -> generic_file_splice_read()  [read from sd->pos]
            nfsd_direct_splice_actor()
                -> __splice_from_pipe()        [update sd->pos]
        }

do_splice_to() updates sd->pos for read, and pass updated sd to
__splice_from_pipe(), and __splice_from_pipe() updates sd->pos for
write. So, next do_splice_to() read from wrong position.
-- 
OGAWA Hirofumi <[email protected]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux