From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Jambor Subject: Re: Access content of file via inodes Date: Mon, 30 May 2005 23:51:27 +0200 Message-ID: <8e70aacf05053014515e301357@mail.gmail.com> References: <4252E09B.9020606@suse.com> <1112948279.28245.4.camel@imp.csi.cam.ac.uk> <8e70aacf0505271213a6834ee@mail.gmail.com> <8e70aacf050528144424ce78ab@mail.gmail.com> Reply-To: Martin Jambor Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from zproxy.gmail.com ([64.233.162.197]:64349 "EHLO zproxy.gmail.com") by vger.kernel.org with ESMTP id S261742AbVE3Vv2 convert rfc822-to-8bit (ORCPT ); Mon, 30 May 2005 17:51:28 -0400 Received: by zproxy.gmail.com with SMTP id 18so2473636nzp for ; Mon, 30 May 2005 14:51:27 -0700 (PDT) To: Anton Altaparmakov In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, On 5/29/05, Anton Altaparmakov wrote: > > I implemented it usng the same approach which ext2 uses to modify its > > directories and believe that is the corect way (by calling aops > > prepare and commit methods). The only thing that puzzles me is that > > Yes that isw fine. Just note that prepare/commit write need to run under > i_sem protection. But if you are already serializing access to the file > some other way then you can ignore i_sem. Do they? Documentation/filesystems/Locking only says they want their page locked... but thanks for telling me, I will check that. > > ext2 does not call flush_dcache_page that you suggested. Since it > > seems to be an architecture specific function, I have no clue what so > > ever whether I need to call it or not. > > Well, as far as I understand it, this function causes changes to the page > contents to become visible on all CPUs and from all processes and needs to > be run before you unlock a page/mark it up to date otherwise someone who > then locks it and/or reads it will possibly read old data from the page > that is no longer correct. Some folks on irc sent me a link to an article that explains this coherency stuff: http://www.informit.com/articles/article.asp?p=29961&seqNum=6&rl=1 Basically, you need to call this only if the page might afterwards be read from the userspace. Directories are not, so ext2 doesn't have to. Thanks again, Martin