Message ID | 1231761731.4371.7.camel@laptop |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote: > Subject: lockdep,mm: fix might_fault() annotation > > Some code (nfs/sunrpc) uses socket ops on kernel memory while holding > the mmap_sem, this is safe because kernel memory doesn't get paged out, > therefore we'll never actually fault, and the might_fault() annotations > will generate false positives. > > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> applied to tip/core/urgent, thanks guys! I also added a: Reported-by: "J. Bruce Fields" <bfields@fieldses.org> line as we always want to preserve the chain of bug reports and attribute them. Ingo -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/mm/memory.c b/mm/memory.c index e009ce8..c2d4c47 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3165,6 +3165,15 @@ void print_vma_addr(char *prefix, unsigned long ip) #ifdef CONFIG_PROVE_LOCKING void might_fault(void) { + /* + * Some code (nfs/sunrpc) uses socket ops on kernel memory while + * holding the mmap_sem, this is safe because kernel memory doesn't + * get paged out, therefore we'll never actually fault, and the + * below annotations will generate false positives. + */ + if (segment_eq(get_fs(), KERNEL_DS)) + return; + might_sleep(); /* * it would be nicer only to annotate paths which are not under