lkml.org 
[lkml]   [2006]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.14 kernels and above copy_to_user stupidity with IRQ disabled check
Probably because you aren't allowed to call copy_to_user while holding a 
spin lock? The user pages might be non resident and you can't have a
page fault with interrupts disabled. Also you don't want to spend a lot
of time with interrupts disabled, and copy_to_user can take a fair
amount of time for large copies.

Jeff V. Merkey wrote:
>
> Is there a good reason someone set a disabled_irq() check on 2.6.14
> and above for copy_to_user to barf out
> tons of bogus stack dump messages if the function is called from
> within a spinlock:
>
> i.e.
>
> spin_lock_irqsave(&regen_lock, regen_flags);
> v = regen_head;
> while (v)
> {
> if (i >= count)
> return -EFAULT;
>
>
> err = copy_to_user(&s[i++], v, sizeof(VIRTUAL_SETUP));
> if (err)
> return err;
>
>
> v = v->next;
> }
> spin_unlock_irqrestore(&regen_lock, regen_flags);
>
> is now busted and worked in kernels up to this point. The error
> message is annoying but non-fatal.
>
> Jeff
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-27 20:33    [W:0.042 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site