mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
[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: Nick Piggin <npiggin@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
30fcffed81
commit
4a76ef036a
1 changed files with 5 additions and 0 deletions
|
@ -125,6 +125,8 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec[i] = present;
|
||||||
}
|
}
|
||||||
pte_unmap_unlock(ptep-1, ptl);
|
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);
|
pgoff = linear_page_index(vma, addr);
|
||||||
for (i = 0; i < nr; i++, pgoff++)
|
for (i = 0; i < nr; i++, pgoff++)
|
||||||
vec[i] = mincore_page(vma->vm_file->f_mapping, pgoff);
|
vec[i] = mincore_page(vma->vm_file->f_mapping, pgoff);
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < nr; i++)
|
||||||
|
vec[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nr;
|
return nr;
|
||||||
|
|
Loading…
Reference in a new issue