Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758164AbYFYP7l (ORCPT ); Wed, 25 Jun 2008 11:59:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751680AbYFYP7c (ORCPT ); Wed, 25 Jun 2008 11:59:32 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:40165 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbYFYP7b (ORCPT ); Wed, 25 Jun 2008 11:59:31 -0400 To: johnpol@2ka.mipt.ru CC: miklos@szeredi.hu, jens.axboe@oracle.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, hugh@veritas.com, nickpiggin@yahoo.com.au In-reply-to: <20080625153025.GB21579@2ka.mipt.ru> (message from Evgeniy Polyakov on Wed, 25 Jun 2008 19:30:25 +0400) Subject: Re: [patch 1/2] mm: dont clear PG_uptodate in invalidate_complete_page2() References: <20080625124038.103406301@szeredi.hu> <20080625124121.839734708@szeredi.hu> <20080625131117.GA28136@2ka.mipt.ru> <20080625141654.GA4803@2ka.mipt.ru> <20080625153025.GB21579@2ka.mipt.ru> Message-Id: From: Miklos Szeredi Date: Wed, 25 Jun 2008 17:59:14 +0200 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 35 > > > > > Like __block_prepare_write()? > > > > > > > > That's called with the page locked and page->mapping verified. > > > > > > Only when called via standard codepath. > > > > It would be a grave error to call it without the page lock. > > Page is locked of course, but invalidated, removed from all trees and > caches, i.e. grab, lock, check, unlock... invalidate, write into that > page should fail, but it will not, since page is uptodate and > prepare_write does not check mapping at all. But callers do check after having locked the page. > > > Instead of returning error when reading from invalid page, now you > > > return old content of it? > > > > No, instead of returning a short count, it is now returning old > > content. > > Or instead of returning error or zero and relookup page eventually, > which can already contain new data, we get old data. Umm, it doesn't make any sense to try to always get fresh data. If you do read() on a file, the data may become old and invalid a millisecond after the read finished. We can't and needn't do anything about this. 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/