From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] loop.c forgot a kmap Date: Thu, 23 May 2002 21:18:56 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <3CEDBF30.1FACBE15@zip.com.au> References: <20020523232024.A2917@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Linux Kernel Return-path: To: Benjamin LaHaise List-Id: linux-fsdevel.vger.kernel.org Benjamin LaHaise wrote: > > The patch below fixes a bug in loop.c that causes highmem systems > to fail spectacularly when a page happens to be allocated in highmem > by replacing the use of page_address with a kmap/kunmap sequence. You must be using a funny kernel, or you have loop on a funny address_space. The current ->prepare_write() API definition requires that the page be kmapped. By ->prepare_write. So it appears that the real bug is actually in whatever you've mounted your loop on. Now, Linus (I think) decided that this wasn't a good API and moves were made to change it. Note how generic_file_write() kmaps the page as well. So we're currently kmapping pages twice on such rare operations as writing to an ext2 file ;) So right now, it's unclear whether the kmap should be done by prepare/commit, or whether it should be done by the caller. I started to clean it up. Al disagreed with Linus. I went and did something else. -