From: Andrew Morton <akpm@osdl.org>
To: Peter Osterlund <petero2@telia.com>
Cc: linux-kernel@vger.kernel.org, axboe@suse.de
Subject: Re: [PATCH] Fix incorrect kunmap_atomic in pktcdvd
Date: Sun, 24 Oct 2004 04:18:27 -0700 [thread overview]
Message-ID: <20041024041827.664845da.akpm@osdl.org> (raw)
In-Reply-To: <m3oeisz7uh.fsf@telia.com>
Peter Osterlund <petero2@telia.com> wrote:
>
> Andrew Morton <akpm@osdl.org> writes:
>
> > Peter Osterlund <petero2@telia.com> wrote:
> > >
> > > The pktcdvd driver uses kunmap_atomic() incorrectly. The function is
> > > supposed to take an address as the first parameter, but the pktcdvd
> > > driver passed a page pointer. Thanks to Douglas Gilbert and Jens Axboe
> > > for discovering this.
> >
> > You're about the 7,000th person to make that mistake. We really should
> > catch it via typechecking but the code's really lame and nobody ever got
> > around to rotorooting it.
>
> Why was the interface made different from kmap()/kunmap() in the first
> place? Wouldn't it have made more sense to let kunmap_atomic() take a
> page pointer as the first parameter?
No, kmap-atomic() maps a single page into the CPU's address space by making
a pte point at the page. To unmap that page we need to get at the pte, not
at the page. If kmap_atomic() were to take a pageframe address we'd need
to search the whole fixmap space for the corresponding page - a reverse
lookup.
next prev parent reply other threads:[~2004-10-24 11:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-23 17:31 [PATCH] Fix incorrect kunmap_atomic in pktcdvd Peter Osterlund
2004-10-24 10:25 ` Andrew Morton
2004-10-24 11:14 ` Peter Osterlund
2004-10-24 11:18 ` Andrew Morton [this message]
2004-10-24 13:21 ` William Lee Irwin III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041024041827.664845da.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=petero2@telia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).