DECLARE_MUTEX_LOCKED(sem); 
int scsi_error_handler(void *data){	struct Scsi_Host *shost = (struct Scsi_Host *) data;	int rtn;	DECLARE_MUTEX_LOCKED(sem);	current->flags |= PF_NOFREEZE;	shost->eh_wait = &sem;	/*	 * Wake up the thread that created us.	 */	SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent of"					  " scsi_eh_%d\n",shost->host_no));	while (1) {		/*		 * If we get a signal, it means we are supposed to go		 * away and die.  This typically happens if the user is		 * trying to unload a module.		 */		SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler"						  " scsi_eh_%d"						  " sleeping\n",shost->host_no));		/*		 * Note - we always use down_interruptible with the semaphore		 * even if the module was loaded as part of the kernel.  The		 * reason is that down() will cause this thread to be counted		 * in the load average as a running process, and down		 * interruptible doesn't.  Given that we need to allow this		 * thread to die if the driver was loaded as a module, using		 * semaphores isn't unreasonable.		 */		down_interruptible(&sem);		if (kthread_should_stop())			break;		SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler"						  " scsi_eh_%d waking"						  " up\n",shost->host_no));		shost->eh_active = 1;		/*		 * We have a host that is failing for some reason.  Figure out		 * what we need to do to get it up and online again (if we can).		 * If we fail, we end up taking the thing offline.		 */		if (shost->hostt->eh_strategy_handler) 			rtn = shost->hostt->eh_strategy_handler(shost);		else			scsi_unjam_host(shost);		shost->eh_active = 0;		/*		 * Note - if the above fails completely, the action is to take		 * individual devices offline and flush the queue of any		 * outstanding requests that may have been pending.  When we		 * restart, we restart any I/O to any other devices on the bus		 * which are still online.		 */		scsi_restart_operations(shost);	}	SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler scsi_eh_%d"					  " exiting\n",shost->host_no));	/*	 * Make sure that nobody tries to wake us up again.	 */	shost->eh_wait = NULL;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/3ed7a4704beb66a155acd67b78b7e9a5674d55fb/scsi_error.c/buggy/drivers/scsi/scsi_error.c