On Tue, Mar 10, 2009 at 03:39:33PM -0700, Andrew Morton wrote: > > Confused. I was too. I copied myself and that's what I saw. Sorry to bother everyone. -- mikem > > > +static int scan_thread(ctlr_info_t *h) > > +{ > > + int rc; > > + DECLARE_COMPLETION_ONSTACK(wait); > > + h->rescan_wait = &wait; > > + > > + while (!kthread_should_stop()) { > > + rc = wait_for_completion_interruptible(&wait); > > + if (!rc) > > + continue; > > + else > > + rebuild_lun_table(h, 0); > > + } > > + return 0; > > +} > > afacit this thread won't ever do anything, > > > +static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c) > > +{ > > + if (c->err_info->SenseInfo[2] != UNIT_ATTENTION) > > + return 0; > > + > > + switch (c->err_info->SenseInfo[12]) { > > + case STATE_CHANGED: > > + printk(KERN_WARNING "cciss%d: a state change " > > + "detected, command retried\n", h->ctlr); > > + return 1; > > + break; > > + case LUN_FAILED: > > + printk(KERN_WARNING "cciss%d: LUN failure " > > + "detected, action required\n", h->ctlr); > > + return 1; > > + break; > > + case REPORT_LUNS_CHANGED: > > + printk(KERN_WARNING "cciss%d: report LUN data " > > + "changed\n", h->ctlr); > > + if (h->rescan_wait) > > + complete(h->rescan_wait); > > because this will cause the wait_for_completion_interruptible() to return 0. > > > + return 1; > > + break; > > + case POWER_OR_RESET: > > + printk(KERN_WARNING "cciss%d: a power on " > > + "or device reset detected\n", h->ctlr); > > + return 1; > > + break; > > + case UNIT_ATTENTION_CLEARED: > > + printk(KERN_WARNING "cciss%d: unit attention " > > + "cleared by another initiator\n", h->ctlr); > > + return 1; > > + break; > > + default: > > + printk(KERN_WARNING "cciss%d: unknown " > > + "unit attention detected\n", h->ctlr); > > + return 1; > > + } > > +} > -- 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