Re: AIC + RAID1 error? (was: Re: aic7xxx errors)

Andreas Steinmetz (ast@domdv.de)
Tue, 11 Sep 2001 01:05:31 +0200 (CEST)


>
> The new driver registers a "reboot notifier" with the system. If MD
> continues to perform I/O after the aic7xxx driver's notification routine
> is called, the result is undefined. The aic7xxx driver has already
> shutdown the hardware. Perhaps I should use a different event to indicate
> it is safe for me to clean up the hardware?
>

Gotcha!

Actually the problem seems to be the raid code and the scsi code do register
reboot notifiers with the same priority (0, see below).

include/linux/notifier.h:

struct notifier_block
{
int (*notifier_call)(struct notifier_block *self, unsigned long, void
*);
struct notifier_block *next;
int priority;
};

drivers/md/md.c:

struct notifier_block md_notifier = {
md_notify_reboot,
NULL,
0
};

drivers/scsi/aic7xxx/aic7xxx_linux.c:

static struct notifier_block ahc_linux_notifier = {
ahc_linux_halt, NULL, 0
};

When registering the notifiers it depends on who's registering first at the
same priority level.

kernel/sys.c:

int notifier_chain_register(struct notifier_block **list, struct notifier_block
*n)
{
write_lock(&notifier_lock);
while(*list)
{
if(n->priority > (*list)->priority)
break;
list= &((*list)->next);
}
n->next = *list;
*list=n;
write_unlock(&notifier_lock);
return 0;
}

The notifier chin is then processed sequentially.

kernel/sys.c:

int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)
{
int ret=NOTIFY_DONE;
struct notifier_block *nb = *n;

while(nb)
{
ret=nb->notifier_call(nb,val,v);
if(ret&NOTIFY_STOP_MASK)
{
return ret;
}
nb=nb->next;
}
return ret;
}

So what's actually required is to set the raid notifier to a higher priority
than the scsi notifier to assert that raid is stopped before scsi.
Unfortunately I can't test this right now as I'm doing work@home and I do need
physical access to the systems (reset button) if it doesn't work out.

Could you please straighten the priority issue out with the raid maintainer?

Andreas Steinmetz
D.O.M. Datenverarbeitung GmbH
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/