]> git.baikalelectronics.ru Git - kernel.git/commit
mlock: operate on any regions with protection != PROT_NONE
authorMichel Lespinasse <walken@google.com>
Tue, 1 Feb 2011 01:03:41 +0000 (17:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Feb 2011 23:20:50 +0000 (10:20 +1100)
commit38388ad4d4a5c909753991c0b31ce1b1f8df29f7
treec134f1772c46e2c5214550aaf08c58b36d755a55
parent2bb5fa724e143f9a5678afcf14efc478906e69bd
mlock: operate on any regions with protection != PROT_NONE

As Tao Ma noticed, change ed1f60e breaks blktrace. This is because
blktrace mmaps a file with PROT_WRITE permissions but without PROT_READ,
so my attempt to not unnecessarity break COW during mlock ended up
causing mlock to fail with a permission problem.

I am proposing to let mlock ignore vma protection in all cases except
PROT_NONE. In particular, mlock should not fail for PROT_WRITE regions
(as in the blktrace case, which broke at ed1f60e) or for PROT_EXEC
regions (which seem to me like they were always broken).

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mlock.c