From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: which dentry a page belongs to Date: Fri, 23 Apr 2004 23:13:54 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040423221354.GB8915@mail.shareable.org> References: <1082732223.1943.11.camel@zaphod> <20040423151458.GC6300@mail.shareable.org> <1082734938.1943.26.camel@zaphod> <20040423173738.A3812@infradead.org> <1082739174.1943.49.camel@zaphod> <20040423180130.A4255@infradead.org> <1082740707.1943.61.camel@zaphod> <20040423173719.GB7335@mail.shareable.org> <1082743140.1943.82.camel@zaphod> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org Return-path: Received: from mail.shareable.org ([81.29.64.88]:43174 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S261602AbUDWWOE (ORCPT ); Fri, 23 Apr 2004 18:14:04 -0400 To: Shaya Potter Content-Disposition: inline In-Reply-To: <1082743140.1943.82.camel@zaphod> List-Id: linux-fsdevel.vger.kernel.org Shaya Potter wrote: > > That means you can get no vmas in i_mmap{,shared} when doing > > perfectly normal writable shared mappings. > > just realized an insanely ugly solution would be for all mapped files to > map inode -> dentry (with code that makes sure they are still valid, i.e > if dentry gets deleted or renamed). Since the page always has it's > inode host, could figure it out via that. Since relatively few mapped > files (compared to amount of files on fs) shouldn't be a huge memory > overhead. It's not ugly, it's wrong. You'd end up verson-controlling the wrong files. It's obvious that you want: 1. Program A opens ("/a/path1", O_RDWR); 1. Program B opens ("/a/path2", O_RDWR); 2. Program A calls mmap. 3. Program B calls mmap. 4. You call your fs version control ioctl. 5. Program A updates data. 6. Program A unmaps or exits, which transfers the dirty bits. 7. Later, ->writepage is called. 6. You store a versioned snapshot of "/a/path1". Your "insanely ugly solution" could easily snapshot "/a/path2" instead. -- Jamie