From: Douglas Gilbert <dougg@torque.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-scsi@vger.kernel.org, adrakoa@es.gnu.org,
"bugme-daemon@kernel-bugs.osdl.org"
<bugme-daemon@bugzilla.kernel.org>,
James Bottomley <James.Bottomley@SteelEye.com>
Subject: Re: [Bug 7994] New: sleeping function called from invalid context at mm/slab.c:3034
Date: Fri, 16 Feb 2007 22:59:31 -0500 [thread overview]
Message-ID: <45D67DA3.2080904@torque.net> (raw)
In-Reply-To: <45D1D1A3.50500@torque.net>
Andrew,
The patch that I sent, shown at the end of this post,
is incomplete as it doesn't check the return value
from kzalloc(..., GFP_ATOMIC).
As I suspected this bug has been exposed before: Jens
reported this problem in early January.
A more complete patch, with some other changes, was
posted 6 weeks ago:
http://marc.theaimsgroup.com/?l=linux-scsi&m=116797354920256&w=2
I'm not sure if this patch is "in the works" or
not.
Doug Gilbert
Douglas Gilbert wrote:
> James Bottomley wrote:
>> On Mon, 2007-02-12 at 20:06 -0800, Andrew Morton wrote:
>>> This is fixed in mainline and I expect that the fix is also lined up
>>> for
>>> 2.6.20.1. (?)
>> It's definitely in mainline. I've cc'd Doug Gilbert, the scsi_debug
>> maintainer to assess what should be done for 2.6.20.1
>
> James,
> I thought this had been addressed but I can't find a
> trail on my laptop. A minimal patch is attached.
>
>
> ChangeLog:
> - Use GFP_ATOMIC for allocations that can be called
> from the queuecommand() entry point
>
> Signed-off-by: Douglas Gilbert <dougg@torque.net>
>
> Doug Gilbert
>
>
>
>
>
> ------------------------------------------------------------------------
>
> --- linux/drivers/scsi/scsi_debug.c 2006-11-30 07:00:01.000000000 -0800
> +++ linux/drivers/scsi/scsi_debug.c2620atom 2007-02-13 06:43:28.000000000 -0800
> @@ -954,7 +954,7 @@
> int alloc_len, n, ret;
>
> alloc_len = (cmd[3] << 8) + cmd[4];
> - arr = kzalloc(SDEBUG_MAX_INQ_ARR_SZ, GFP_KERNEL);
> + arr = kzalloc(SDEBUG_MAX_INQ_ARR_SZ, GFP_ATOMIC);
> if (devip->wlun)
> pq_pdt = 0x1e; /* present, wlun */
> else if (scsi_debug_no_lun_0 && (0 == devip->lun))
> @@ -1217,7 +1217,7 @@
> alen = ((cmd[6] << 24) + (cmd[7] << 16) + (cmd[8] << 8)
> + cmd[9]);
>
> - arr = kzalloc(SDEBUG_MAX_TGTPGS_ARR_SZ, GFP_KERNEL);
> + arr = kzalloc(SDEBUG_MAX_TGTPGS_ARR_SZ, GFP_ATOMIC);
> /*
> * EVPD page 0x88 states we have two ports, one
> * real and a fake port with no device connected.
> @@ -2044,7 +2044,7 @@
> }
> }
> if (NULL == open_devip) { /* try and make a new one */
> - open_devip = kzalloc(sizeof(*open_devip),GFP_KERNEL);
> + open_devip = kzalloc(sizeof(*open_devip),GFP_ATOMIC);
> if (NULL == open_devip) {
> printk(KERN_ERR "%s: out of memory at line %d\n",
> __FUNCTION__, __LINE__);
next prev parent reply other threads:[~2007-02-17 3:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200702130307.l1D378vc003798@fire-2.osdl.org>
2007-02-13 4:06 ` [Bug 7994] New: sleeping function called from invalid context at mm/slab.c:3034 Andrew Morton
2007-02-13 14:17 ` James Bottomley
2007-02-13 14:56 ` Douglas Gilbert
2007-02-17 3:59 ` Douglas Gilbert [this message]
2007-02-17 5:54 ` Andrew Morton
2007-02-17 13:19 ` Douglas Gilbert
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=45D67DA3.2080904@torque.net \
--to=dougg@torque.net \
--cc=James.Bottomley@SteelEye.com \
--cc=adrakoa@es.gnu.org \
--cc=akpm@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).