Re: [Bug 7994] New: sleeping function called from invalid context at mm/slab.c:3034

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> 
> 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__);

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux