lkml.org 
[lkml]   [2015]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectLTP regressions due to 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
Hi Kirill,

Your patch 6dc296e7df4c ("mm: make sure all file VMAs have ->vm_ops set")
causes some mmap regressions in LTP, which appears to use a MAP_PRIVATE
mmap of /dev/zero as a way to get anonymous pages in some of its tests
(specifically mmap10 [1]).

Dead simple reproducer below. Is this change in behaviour intentional?

Will

[1]
http://sourceforge.net/p/ltp/git/ci/1eb440c2b5fe43a3e5023015a16aa5d7d3385b1e/tree/testcases/kernel/syscalls/mmap/mmap10.c

--->8

#include <sys/mman.h>
#include <sys/stat.h>

#include <fcntl.h>
#include <stdio.h>

#define MAP_SZ 5*1024*1024

int main(void)
{
char *foo;
int fd;

fd = open("/dev/zero", O_RDWR, 0666);
if (fd < 0) {
perror(NULL);
return fd;
}

foo = mmap(NULL, MAP_SZ, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (foo == MAP_FAILED) {
perror(NULL);
return -1;
}

foo[MAP_SZ >> 1] = 0; // Generates SIGBUS with 4.3-rc1
return 0;
}


\
 
 \ /
  Last update: 2015-09-14 13:21    [W:0.071 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site