From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756539Ab0FDRMP (ORCPT ); Fri, 4 Jun 2010 13:12:15 -0400 Received: from cantor.suse.de ([195.135.220.2]:34864 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298Ab0FDRMN (ORCPT ); Fri, 4 Jun 2010 13:12:13 -0400 Date: Fri, 4 Jun 2010 19:11:52 +0200 From: Jan Kara To: "J. Bruce Fields" Cc: Jan Kara , Boaz Harrosh , Vladislav Bolkhovitin , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, James Bottomley , Christof Schmitt , lsf10-pc@lists.linuxfoundation.org, Al Viro , linux-fsdevel@vger.kernel.org, Matthew Wilcox , Ric Wheeler , Christoph Hellwig Subject: Re: [Lsf10-pc] [LFS/VM TOPIC] Stable pages while IO (was Wrong DIF guard tag on ext2 write) Message-ID: <20100604171151.GH3414@quack.suse.cz> References: <20100531112817.GA16260@schmichrtp.mainz.de.ibm.com> <4C07D3D0.8010500@panasas.com> <20100604162332.GF3414@quack.suse.cz> <20100604163009.GF10153@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100604163009.GF10153@fieldses.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 04-06-10 12:30:09, J. Bruce Fields wrote: > On Fri, Jun 04, 2010 at 06:23:32PM +0200, Jan Kara wrote: > > On Thu 03-06-10 19:09:52, Boaz Harrosh wrote: > > > [Topic] > > > How to not let pages change while in IO > > > > > > [Abstract] > > > As seen in a long thread on the fsdvel scsi mailing lists. Lots of > > > people have headaches and sleep less nights because individual pages > > > can change while in IO and/or DMA. Though each one as slightly different > > > needs, the mechanics look to be the same. > > Hmm, I don't think it's really about "how to not let pages change" - that > > is doable by using wait_on_page_writeback() in ->page_mkwrite and > > ->write_begin. > > Will the same work for the NFS server checksumming page data in read > replies? Currently it won't. The above relies on the fact that when we clear dirty page flag in clear_page_dirty_for_io we also write-protect the page. Moreover I suppose you don't set PageWriteback when serving a content from a page... But an elegant way to solve this would IMHO be to do: lock_page(page); if (page_mkclean(page)) set_page_dirty(page); and now you can be sure that until you unlock the page it cannot be modified because both ->page_mkwrite and ->write_begin need page lock before they can go and modify a page... Honza -- Jan Kara SUSE Labs, CR