diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mm/memory.c b/mm/memory.c index 22e037e3364e..17734c3c1183 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -3737,7 +3737,7 @@ void print_vma_addr(char *prefix, unsigned long ip) | |||
3737 | } | 3737 | } |
3738 | 3738 | ||
3739 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 3739 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) |
3740 | void might_fault(void) | 3740 | void __might_fault(const char *file, int line) |
3741 | { | 3741 | { |
3742 | /* | 3742 | /* |
3743 | * Some code (nfs/sunrpc) uses socket ops on kernel memory while | 3743 | * Some code (nfs/sunrpc) uses socket ops on kernel memory while |
@@ -3747,21 +3747,15 @@ void might_fault(void) | |||
3747 | */ | 3747 | */ |
3748 | if (segment_eq(get_fs(), KERNEL_DS)) | 3748 | if (segment_eq(get_fs(), KERNEL_DS)) |
3749 | return; | 3749 | return; |
3750 | 3750 | if (pagefault_disabled()) | |
3751 | /* | ||
3752 | * it would be nicer only to annotate paths which are not under | ||
3753 | * pagefault_disable, however that requires a larger audit and | ||
3754 | * providing helpers like get_user_atomic. | ||
3755 | */ | ||
3756 | if (in_atomic()) | ||
3757 | return; | 3751 | return; |
3758 | 3752 | __might_sleep(file, line, 0); | |
3759 | __might_sleep(__FILE__, __LINE__, 0); | 3753 | #if defined(CONFIG_DEBUG_ATOMIC_SLEEP) |
3760 | |||
3761 | if (current->mm) | 3754 | if (current->mm) |
3762 | might_lock_read(¤t->mm->mmap_sem); | 3755 | might_lock_read(¤t->mm->mmap_sem); |
3756 | #endif | ||
3763 | } | 3757 | } |
3764 | EXPORT_SYMBOL(might_fault); | 3758 | EXPORT_SYMBOL(__might_fault); |
3765 | #endif | 3759 | #endif |
3766 | 3760 | ||
3767 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) | 3761 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) |