Skip to content

Commit

Permalink
[PATCH] mincore: fill in results properly
Browse files Browse the repository at this point in the history
Paper bag time. Thanks to Randy for noticing that I didn't actually assign
'present' to anything.

Unfortunately my original patch passed the few simple test cases I gave it,
purely by coincidence.

Signed-off-by: Nick Piggin <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Feb 15, 2007
1 parent 30fcffe commit 4a76ef0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mm/mincore.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
#endif
}
}

vec[i] = present;
}
pte_unmap_unlock(ptep-1, ptl);

Expand All @@ -135,6 +137,9 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
pgoff = linear_page_index(vma, addr);
for (i = 0; i < nr; i++, pgoff++)
vec[i] = mincore_page(vma->vm_file->f_mapping, pgoff);
} else {
for (i = 0; i < nr; i++)
vec[i] = 0;
}

return nr;
Expand Down

0 comments on commit 4a76ef0

Please sign in to comment.