From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: same page access Date: Wed, 22 Oct 2003 12:21:28 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20031022112128.GN18370@parcelfarce.linux.theplanet.co.uk> References: <1065553341.8172.45.camel@patehci2> <1065635511.7602.38.camel@patehci2> <1066773266.2888.83.camel@patehci2> <200310221015.17946.mark@lemna.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:3531 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S263609AbTJVLV3 (ORCPT ); Wed, 22 Oct 2003 07:21:29 -0400 To: Mark B Content-Disposition: inline In-Reply-To: <200310221015.17946.mark@lemna.hr> List-Id: linux-fsdevel.vger.kernel.org On Wed, Oct 22, 2003 at 10:15:17AM +0200, Mark B wrote: > I usually dig around kernel code to find answers, but I think this would take > alot more time to dig than to explain from someone. > > Process 1 opens a file x, and does a read on the first few bytes, which in > turn causes kernel to load the first page from the file (if the filesystem is > using address_space_operations for all of it's access to files) > Now a process 2 opens the same file and overwrites a few first bytes. > > Now, how does the kernel update the Process 1's page if it is already loaded? It doesn't. A subsequent write() to a file doesn't affect any previous read()s by this or any other process. The situation is diferent if you're talking about mmap(), but as far as I can tell, you aren't. -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk