Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbYG3Uq3 (ORCPT ); Wed, 30 Jul 2008 16:46:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751059AbYG3UqT (ORCPT ); Wed, 30 Jul 2008 16:46:19 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:59695 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbYG3UqS (ORCPT ); Wed, 30 Jul 2008 16:46:18 -0400 To: torvalds@linux-foundation.org CC: miklos@szeredi.hu, jens.axboe@oracle.com, akpm@linux-foundation.org, nickpiggin@yahoo.com.au, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org In-reply-to: (message from Linus Torvalds on Wed, 30 Jul 2008 13:13:48 -0700 (PDT)) Subject: Re: [patch v3] splice: fix race with page invalidation References: <20080730175406.GN20055@kernel.dk> <20080730194516.GO20055@kernel.dk> Message-Id: From: Miklos Szeredi Date: Wed, 30 Jul 2008 22:45:34 +0200 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1751 Lines: 43 On Wed, 30 Jul 2008, Linus Torvalds wrote: > On Wed, 30 Jul 2008, Miklos Szeredi wrote: > > > > Take this patch as a bugfix. It's not in any way showing the way > > forward: as soon as you have the time, you can revert it and start > > from the current state. > > > > Hmm? > > I dislike that mentality. > > The fact is, it's not a bug-fix, it's just papering over the real problem. It _is_ a bug fix. See here, from man 2 splice: RETURN VALUE Upon successful completion, splice() returns the number of bytes spliced to or from the pipe. A return value of 0 means that there was no data to transfer, and it would not make sense to block, because there are no writers connected to the write end of the pipe referred to by fd_in. Currently splice on NFS, FUSE and a few other filesystems don't conform to that clause: splice can return zero even if there's still data to be read, just because the data happened to be invalidated during the splicing. That's a plain and clear bug, which has absolutely nothing to do with NFS _exporting_. > And by papering it over, it then just makes people less likely to bother > with the real issue. I think you are talking about a totally separate issue: that NFSD's use of splice can result in strange things if the file is truncated while being read. But this is an NFSD issue and I don't see that it has _anything_ to do with the above bug in splice. I think you are just confusing the two things. Miklos -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/