[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTikycDykLRPnRZFAbdIszTOMDVFoX4DGiLcCvSqd@mail.gmail.com>
Date: Sat, 29 May 2010 22:22:54 +0800
From: Changli Gao <xiaosuo@...il.com>
To: Jamie Lokier <jamie@...reable.org>
Cc: Miklos Szeredi <miklos@...redi.hu>, axboe@...nel.dk,
viro@...iv.linux.org.uk, mszeredi@...e.cz,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] splice: fix updating sd->pos wrongly
On Sat, May 29, 2010 at 10:09 PM, Jamie Lokier <jamie@...reable.org> wrote:
>
> Not true if the "file" is /dev/mem or /dev/kmem. The starting offset
> can be negative, so can end at zero.
>
> It's an obscure case and I don't know if you can sendfile from
> /dev/{,k}mem anyway :-) but illustrates why sd->pos != 0 is dubious.
>
So the safe way is checking if splice_read() updates pos or not, isn't it?
if (sd->pos != prev_pos)
sd->pos = prev_pos + ret;
--
Regards,
Changli Gao(xiaosuo@...il.com)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists