From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changli Gao Subject: Re: [PATCH v2 4/4] splice: fix updating sd->pos wrongly Date: Fri, 28 May 2010 18:55:23 +0800 Message-ID: References: <1274885083-15735-1-git-send-email-xiaosuo@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: axboe@kernel.dk, viro@zeniv.linux.org.uk, mszeredi@suse.cz, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Miklos Szeredi Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:63488 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754728Ab0E1Kzn convert rfc822-to-8bit (ORCPT ); Fri, 28 May 2010 06:55:43 -0400 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, May 28, 2010 at 6:13 PM, Miklos Szeredi wro= te: > On Fri, 28 May 2010, Changli Gao wrote: >> On Fri, May 28, 2010 at 5:42 PM, Miklos Szeredi = wrote: >> > On Wed, 26 May 2010, Changli Gao wrote: >> >> fix updating sd->pos wrongly. >> >> >> >> In error path, we don't need to updating sd->pos, if the file isn= 't seekable. >> > >> > This patch is nonsense. =C2=A0Why should we handle sd->pos !=3D 0 = case >> > differently? >> > >> >> If the in file isn't seekable, its splice_read won't update *ppos, s= o >> in the error path, we'd better not change it too. Otherwise, some >> assumption will go wrong. > > That may be true, but the patch is still nonsense. > > Look, your patch is updating/not updating sd->pos based on whether it > is zero or not. =C2=A0It will prevent updating the position for socke= ts, > but it will also prevent updating the position for regular files if > the position is zero, which is really not what we want. I think you misread my patch. 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. --=20 Regards=EF=BC=8C Changli Gao(xiaosuo@gmail.com) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html