public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: "Jeff V. Merkey" <jmerkey@wolfmountaingroup.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.14 kernels and above copy_to_user stupidity with IRQ disabled check
Date: Fri, 27 Jan 2006 14:30:36 -0500	[thread overview]
Message-ID: <43DA74DC.3000702@cfl.rr.com> (raw)
In-Reply-To: <43DA62CC.8090309@wolfmountaingroup.com>

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
>


  reply	other threads:[~2006-01-27 19:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-27 18:13 2.6.14 kernels and above copy_to_user stupidity with IRQ disabled check Jeff V. Merkey
2006-01-27 19:30 ` Phillip Susi [this message]
2006-01-27 20:18 ` linux-os (Dick Johnson)
2006-01-27 20:10   ` jmerkey
2006-01-27 20:22     ` jmerkey
2006-01-27 20:39     ` Phillip Susi
2006-01-27 19:28       ` Jeff V. Merkey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43DA74DC.3000702@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=jmerkey@wolfmountaingroup.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox