- Complete the fix for broken REQUEST SENSE

- Cleanup: cleanup_lock shouldn't be IRQ


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@412 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-06-13 10:31:50 +00:00
parent da47dc7a6c
commit 692c895cb5
2 changed files with 14 additions and 14 deletions

View File

@@ -2716,9 +2716,9 @@ static int dev_user_release(struct inode *inode, struct file *file)
down_write(&dev->dev_rwsem);
spin_lock_irq(&cleanup_lock);
spin_lock(&cleanup_lock);
list_add_tail(&dev->cleanup_list_entry, &cleanup_list);
spin_unlock_irq(&cleanup_lock);
spin_unlock(&cleanup_lock);
wake_up(&cleanup_list_waitQ);
wake_up(&dev->cmd_lists.cmd_list_waitQ);
@@ -2823,7 +2823,7 @@ static int dev_user_cleanup_thread(void *arg)
current->flags |= PF_NOFREEZE;
spin_lock_irq(&cleanup_lock);
spin_lock(&cleanup_lock);
while (!kthread_should_stop()) {
wait_queue_t wait;
init_waitqueue_entry(&wait, current);
@@ -2834,9 +2834,9 @@ static int dev_user_cleanup_thread(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
if (test_cleanup_list())
break;
spin_unlock_irq(&cleanup_lock);
spin_unlock(&cleanup_lock);
schedule();
spin_lock_irq(&cleanup_lock);
spin_lock(&cleanup_lock);
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&cleanup_list_waitQ, &wait);
@@ -2859,9 +2859,9 @@ static int dev_user_cleanup_thread(void *arg)
typeof(*dev), cleanup_list_entry);
list_del(&dev->cleanup_list_entry);
spin_unlock_irq(&cleanup_lock);
spin_unlock(&cleanup_lock);
rc = dev_user_process_cleanup(dev);
spin_lock_irq(&cleanup_lock);
spin_lock(&cleanup_lock);
if (rc != 0)
list_add_tail(&dev->cleanup_list_entry,
@@ -2871,9 +2871,9 @@ static int dev_user_cleanup_thread(void *arg)
if (list_empty(&cl_devs))
break;
spin_unlock_irq(&cleanup_lock);
spin_unlock(&cleanup_lock);
msleep(100);
spin_lock_irq(&cleanup_lock);
spin_lock(&cleanup_lock);
while (!list_empty(&cl_devs)) {
dev = list_entry(cl_devs.next, typeof(*dev),
@@ -2883,7 +2883,7 @@ static int dev_user_cleanup_thread(void *arg)
}
}
}
spin_unlock_irq(&cleanup_lock);
spin_unlock(&cleanup_lock);
/*
* If kthread_should_stop() is true, we are guaranteed to be

View File

@@ -2319,17 +2319,17 @@ out:
return res;
}
static int scst_pre_dev_done(struct scst_cmd *cmd)
static int scst_pre_dev_done(struct scst_cmd **pcmd)
{
int res = SCST_CMD_STATE_RES_CONT_SAME, rc;
TRACE_ENTRY();
rc = scst_done_cmd_check(&cmd, &res);
rc = scst_done_cmd_check(pcmd, &res);
if (rc)
goto out;
cmd->state = SCST_CMD_STATE_DEV_DONE;
(*pcmd)->state = SCST_CMD_STATE_DEV_DONE;
out:
TRACE_EXIT_HRES(res);
@@ -3153,7 +3153,7 @@ void scst_process_active_cmd(struct scst_cmd *cmd, int context)
break;
case SCST_CMD_STATE_PRE_DEV_DONE:
res = scst_pre_dev_done(cmd);
res = scst_pre_dev_done(&cmd);
EXTRACHECKS_BUG_ON(res ==
SCST_CMD_STATE_RES_NEED_THREAD);
break;