From: wwhistory <wwh...@gm...> - 2006-09-07 09:05:26
|
hi, In the function "scst_alloc_add_tgt_dev"(scst_lib.c), we set the &tgt_dev->tgt_dev_flags to SCST_TGT_DEV_RESETTED, as follows: __set_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags); In the function "scst_pre_exec"(scst_targ.c), we see: if (unlikely(test_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags)) && scst_is_ua_command(cmd)) { struct scst_device *dev = cmd->dev; int done = 0; spin_lock_bh(&dev->dev_lock); if (test_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags)) { printk("SCST_TGT_DEV_RESETTED set\n"); clear_bit(SCST_TGT_DEV_RESETTED, &tgt_dev->tgt_dev_flags); scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_reset_UA)); cmd->ua_ignore = 1; clear_bit(SCST_CMD_ABORTED, &cmd->cmd_flags); clear_bit(SCST_CMD_NO_RESP, &cmd->cmd_flags); done = 1; } spin_unlock_bh(&dev->dev_lock); if (done) { res = SCST_EXEC_COMPLETED; /* Report the result */ scst_cmd_done_local(cmd, SCST_CMD_STATE_DEFAULT); goto out; } } Here I found the first commad except of INQUIRY, REQUEST_SENSE and REPORT_LUNS will satisfy the if condition, and then scst_set_cmd_error. Then the next command is REQUEST_SENSE. I don't know why we set the &tgt_dev->tgt_dev_flags to SCST_TGT_DEV_RESETTED in the function "scst_alloc_add_tgt_dev"(scst_lib.c). Can somebody help me? wwhistory 2006-09-07 |