RE: 2.6.8-rc3-mm2: Debug: sleeping function called from invalid context at mm/mempool.c:197

Andrew Vasquez
2004-08-09T23:56:36Z

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

On Monday, August 09, 2004 6:42 AM, linux-kernel-owner@vger.kernel.org
wrote:
> I see the msg below while running on 2.6.8-rc3-mm2, but not
> on the plain
> rc3 tree;
> ditto for rc1-mm1 vs rc1, which is as far back as I've gone so far.
>

This allocation should be done with GFP_ATOMIC flags. The attached
patch should apply cleanly to any recent kernel.

Regards,
Andrew Vasquez

[-- Attachment #2: mpool_alloc.diff --]
[-- Type: application/octet-stream, Size: 392 bytes --]

===== drivers/scsi/qla2xxx/qla_os.c 1.39 vs edited =====
--- 1.39/drivers/scsi/qla2xxx/qla_os.c 2004-07-12 09:54:49 -07:00
+++ edited/drivers/scsi/qla2xxx/qla_os.c 2004-08-09 16:48:29 -07:00
@@ -3590,7 +3590,7 @@
{
srb_t *sp;

- sp = mempool_alloc(ha->srb_mempool, GFP_KERNEL);
+ sp = mempool_alloc(ha->srb_mempool, GFP_ATOMIC);
if (sp)
atomic_set(&sp->ref_count, 1);
return (sp);