Skip to content

Commit

Permalink
sys_remap_file_pages: fix ->vm_file accounting
Browse files Browse the repository at this point in the history
Fix ->vm_file accounting, mmap_region() may do do_munmap().

Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Feb 5, 2008
1 parent c0b49b0 commit 8a459e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mm/fremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,13 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
*/
if (mapping_cap_account_dirty(mapping)) {
unsigned long addr;
struct file *file = vma->vm_file;

flags &= MAP_NONBLOCK;
addr = mmap_region(vma->vm_file, start, size,
get_file(file);
addr = mmap_region(file, start, size,
flags, vma->vm_flags, pgoff, 1);
fput(file);
if (IS_ERR_VALUE(addr)) {
err = addr;
} else {
Expand Down

0 comments on commit 8a459e4

Please sign in to comment.