From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [PATCH 3/3] AFS: Implement basic file write support Date: Thu, 10 May 2007 10:56:32 +0100 Message-ID: <27482.1178790992@warthog.cambridge.redhat.com> References: <46425C55.6050000@yahoo.com.au> <20070508194358.27477.74888.stgit@warthog.cambridge.redhat.com> <20070508194411.27477.7552.stgit@warthog.cambridge.redhat.com> Cc: David Howells , akpm@osdl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: In-Reply-To: <46425C55.6050000@yahoo.com.au> Sender: netdev-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Nick Piggin wrote: > Why do you call SetPageUptodate when the page is not up to date? > That leaks uninitialised data, AFAIKS. It only seems that way. If afs_prepare_write() is called, but doesn't return an error, then afs_commit_write() will be called, and it seems that the copy in of the data will be guaranteed not to fail by the caller. Furthermore, afs_prepare_page() will have filled in the missing bits. And whilst all that is going on, the page lock will be help by the caller, so that no-one else can access the partially complete page. I suppose I could call SetPageUptodate() in afs_commit_write() instead. David