mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Tuttle" <ttuttle@google.com>
To: "Matt Mackall" <mpm@selenic.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] pagemap: Modify add_to_pagemap to use copy_to_user instead of put_user.
Date: Thu, 5 Jun 2008 12:01:06 -0400	[thread overview]
Message-ID: <4ca0a85e0806050901q52deba94r3056fdb0e7d46c8c@mail.gmail.com> (raw)
In-Reply-To: <1212681477.3953.154.camel@calx>

On Thu, Jun 5, 2008 at 11:57 AM, Matt Mackall <mpm@selenic.com> wrote:
>
> On Thu, 2008-06-05 at 11:04 -0400, Thomas Tuttle wrote:
>> While fiddling with pagemap, I discovered a bug in add_to_pagemap.
>> When it is copying an entry that is not at the end of the buffer, it
>> uses put_user to copy a u64 into a char* buffer.  The problem is that
>> put_user determines how much to copy based on the size of the
>> *destination*, not the source, so it only copied one byte.  To fix
>> this, I replaced the call to put_user with a call to copy_to_user, as
>> is used when copying the last (possibly partial) PFN into the buffer.0
>
> This looks fine to me, so:
>
> Acked-by: Matt Mackall <mpm@selenic.com>
>
> But your 3/5 undoes this, right? So we should just take one or the other
> route. While I like going the simplifying route, it's not very pretty
> from the user interface point of view. But it does have plenty of
> precedent in direct-I/O-like things.

No, my 3/5 further keeps the use of copy_to_user instead of put_user,
but eliminates entirely the code for partial reads.  3/5 depends on
1/5.

--ttuttle

  reply	other threads:[~2008-06-05 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 15:04 Thomas Tuttle
2008-06-05 15:57 ` Matt Mackall
2008-06-05 16:01   ` Thomas Tuttle [this message]
2008-06-05 16:20     ` Matt Mackall
2008-06-05 19:02 ` Andrew Morton
2008-06-05 19:06   ` Matt Mackall
2008-06-05 19:09     ` Thomas Tuttle

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=4ca0a85e0806050901q52deba94r3056fdb0e7d46c8c@mail.gmail.com \
    --to=ttuttle@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.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

all inboxes | Powered by JetHome®