From: Christopher Yeoh <cyeoh@samba.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org, trivial@rustcorp.com.au
Subject: [PATCH] msync writing when MS_INVALIDATE set and memory locked
Date: Fri, 22 Mar 2002 16:16:34 +1100 [thread overview]
Message-ID: <15514.48690.588277.606822@gargle.gargle.HOWL> (raw)
For msync, SUSv2 states that it will fail if:
"[EBUSY] Some or all of the addresses in the range starting at addr
and continuing for len bytes are locked, and MS_INVALIDATE is
specified."
This check isn't being done. The following patch (against 2.4.19pre4)
adds the correct behaviour:
--- linux-2.4.18/mm/filemap.c~ Thu Mar 21 16:04:48 2002
+++ linux-2.4.18/mm/filemap.c Fri Mar 22 15:48:40 2002
@@ -2205,6 +2205,9 @@
int ret = 0;
struct file * file = vma->vm_file;
+ if ( (flags & MS_INVALIDATE) && (vma->vm_flags & VM_LOCKED) )
+ return -EBUSY;
+
if (file && (vma->vm_flags & VM_SHARED)) {
ret = filemap_sync(vma, start, end-start, flags);
Chris
--
cyeoh@au.ibm.com
IBM OzLabs Linux Development Group
Canberra, Australia
reply other threads:[~2002-03-22 5:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=15514.48690.588277.606822@gargle.gargle.HOWL \
--to=cyeoh@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=trivial@rustcorp.com.au \
/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).