On Sun, Sep 24, 2006 at 03:43:45PM -0400, Dave Jones wrote: > On Sun, Sep 24, 2006 at 01:06:24PM -0600, Matthew Wilcox wrote: > > + > > +int scsi_complete_async_scans(void) > > +{ > > + struct async_scan_data *data; > > + > > + do { > > + if (list_empty(&scanning_hosts)) > > + return 0; > > + data = kmalloc(sizeof(*data), GFP_KERNEL); > > + if (!data) > > + msleep(1); > > + } while (!data); > > does __GFP_NOFAIL or __GFP_REPEAT have the desired effect here? Well ... that would probably be OK. But I think it's actually preferable to not use it. See, the scan might finish while we're waiting for memory, and if it does, then we don't need to allocate memory after all. This is totally quibbling over the most unlikely of scenarios though, so I have no problem with making the change if we just want to exemplify best practice here. - 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