From: Andi Kleen Add might_sleep to more *_user functions. Signed-off-by: Andrew Morton --- 25-akpm/arch/x86_64/lib/csum-wrappers.c | 2 ++ 25-akpm/arch/x86_64/lib/usercopy.c | 2 ++ 2 files changed, 4 insertions(+) diff -puN arch/x86_64/lib/csum-wrappers.c~x86-64-add-might_sleeps-to-more-_user-functions arch/x86_64/lib/csum-wrappers.c --- 25/arch/x86_64/lib/csum-wrappers.c~x86-64-add-might_sleeps-to-more-_user-functions Tue Sep 14 17:03:35 2004 +++ 25-akpm/arch/x86_64/lib/csum-wrappers.c Tue Sep 14 17:03:35 2004 @@ -22,6 +22,7 @@ unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, int len, unsigned int isum, int *errp) { + might_sleep(); *errp = 0; if (likely(access_ok(VERIFY_READ,src, len))) { /* Why 6, not 7? To handle odd addresses aligned we @@ -69,6 +70,7 @@ unsigned int csum_partial_copy_to_user(const char *src, char __user *dst, int len, unsigned int isum, int *errp) { + might_sleep(); if (unlikely(!access_ok(VERIFY_WRITE, dst, len))) { *errp = -EFAULT; return 0; diff -puN arch/x86_64/lib/usercopy.c~x86-64-add-might_sleeps-to-more-_user-functions arch/x86_64/lib/usercopy.c --- 25/arch/x86_64/lib/usercopy.c~x86-64-add-might_sleeps-to-more-_user-functions Tue Sep 14 17:03:35 2004 +++ 25-akpm/arch/x86_64/lib/usercopy.c Tue Sep 14 17:03:35 2004 @@ -14,6 +14,7 @@ #define __do_strncpy_from_user(dst,src,count,res) \ do { \ long __d0, __d1, __d2; \ + might_sleep(); \ __asm__ __volatile__( \ " testq %1,%1\n" \ " jz 2f\n" \ @@ -63,6 +64,7 @@ strncpy_from_user(char *dst, const char unsigned long __clear_user(void __user *addr, unsigned long size) { long __d0; + might_sleep(); /* no memory constraint because it doesn't change any memory gcc knows about */ asm volatile( _