Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6867
b: refs/heads/master
c: 836d5ff
h: refs/heads/master
i:
  6865: f8b92ec
  6863: 08505f3
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Sep 5, 2005
1 parent c24a3e6 commit d04b29b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53e9a6159fdc6419874ce4d86d3577dbedc77b62
refs/heads/master: 836d5ffd34550901ea024347693e689273ded8aa
9 changes: 5 additions & 4 deletions trunk/mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static long madvise_behavior(struct vm_area_struct * vma,

if (new_flags == vma->vm_flags) {
*prev = vma;
goto success;
goto out;
}

pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
Expand All @@ -62,6 +62,7 @@ static long madvise_behavior(struct vm_area_struct * vma,
goto out;
}

success:
/*
* vm_flags is protected by the mmap_sem held in write mode.
*/
Expand All @@ -70,7 +71,6 @@ static long madvise_behavior(struct vm_area_struct * vma,
out:
if (error == -ENOMEM)
error = -EAGAIN;
success:
return error;
}

Expand Down Expand Up @@ -237,8 +237,9 @@ asmlinkage long sys_madvise(unsigned long start, size_t len_in, int behavior)
* - different from the way of handling in mlock etc.
*/
vma = find_vma_prev(current->mm, start, &prev);
if (!vma && prev)
vma = prev->vm_next;
if (vma && start > vma->vm_start)
prev = vma;

for (;;) {
/* Still start < end. */
error = -ENOMEM;
Expand Down

0 comments on commit d04b29b

Please sign in to comment.