Skip to content
Snippets Groups Projects
Commit 4a76ef03 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Linus Torvalds
Browse files

[PATCH] mincore: fill in results properly


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: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 30fcffed
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment