Re: [PATCH] loop.c forgot a kmap

Andrew Morton (akpm@zip.com.au)
Thu, 23 May 2002 21:18:56 -0700


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.

-
-
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/