public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Zan Lynx <zlynx@acm.org>,
	linux-kernel@vger.kernel.org, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH 1/2] msync: support syncing a small part of the file
Date: Thu, 14 Jun 2012 10:57:30 +0200	[thread overview]
Message-ID: <4FD9A77A.9020502@redhat.com> (raw)
In-Reply-To: <20120613150809.44149ef6.akpm@linux-foundation.org>

Il 14/06/2012 00:08, Andrew Morton ha scritto:
>> > As an interested observer and a programmer who uses msync()...
>> > 
>> > I never assumed msync() did the whole file.
> OK, that's one user accounted for.  3 million to go.
> 
> Look, I'm not terribly averse to the change, but it does have this
> risk.  And it's a nasty risk because anyone who is hit by it simply
> will not know that his applcation has lost some of its data integrity.

Sure, it reminds me of the recent bug caused by using memcpy with
overlapping areas.

But really, in this case the possibility for confusion is really small,
and would entirely be the fault of the programmer.  There are argument
for addr and length, and the man page says: "To be more precise, the
part of the file that corresponds to the memory area starting at addr
and having length length is updated".  Our implementation having been
suboptimal for a long time, is not a good reason to keep it suboptimal.

Anyway yes, there is an off-by-one.

Paolo

  reply	other threads:[~2012-06-14  8:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 20:43 [PATCH 0/2] msync improvements Paolo Bonzini
2012-05-31 20:43 ` [PATCH 1/2] msync: support syncing a small part of the file Paolo Bonzini
2012-06-13 21:26   ` Andrew Morton
2012-06-13 21:51     ` Zan Lynx
2012-06-13 22:08       ` Andrew Morton
2012-06-14  8:57         ` Paolo Bonzini [this message]
2012-05-31 20:43 ` [PATCH 2/2] msync: start async writeout when MS_ASYNC Paolo Bonzini
2012-06-13 21:29   ` Andrew Morton
2012-06-14  9:02     ` Paolo Bonzini
2012-06-14 10:07       ` Andrew Morton
2012-06-14 10:19         ` Paolo Bonzini
2012-06-14 12:24     ` Paolo Bonzini
2012-06-12 15:38 ` [PATCH 0/2] msync improvements Paolo Bonzini

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=4FD9A77A.9020502@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zlynx@acm.org \
    /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