mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Fix queuing of UA for aborted by PREEMPT AND ABORT, if TAS is 0, + some clarifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5467 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -8061,6 +8061,17 @@ void scst_process_reset(struct scst_device *dev,
|
||||
uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN];
|
||||
int sl = scst_set_sense(sense_buffer, sizeof(sense_buffer),
|
||||
dev->d_sense, SCST_LOAD_SENSE(scst_sense_reset_UA));
|
||||
/*
|
||||
* Potentially, setting UA here, when the aborted commands are
|
||||
* still running, can lead to a situation that one of them could
|
||||
* take it, then that would be detected and the UA requeued.
|
||||
* But, meanwhile, one or more subsequent, i.e. not aborted,
|
||||
* commands can "leak" executed normally. So, as result, the
|
||||
* UA would be delivered one or more commands "later". However,
|
||||
* that should be OK, because, if multiple commands are being
|
||||
* executed in parallel, you can't control exact order of UA
|
||||
* delivery anyway.
|
||||
*/
|
||||
scst_dev_check_set_local_UA(dev, exclude_cmd, sense_buffer, sl);
|
||||
}
|
||||
|
||||
|
||||
@@ -565,6 +565,27 @@ static void scst_pr_abort_reg(struct scst_device *dev,
|
||||
*/
|
||||
PRINT_ERROR("SCST_PR_ABORT_ALL failed %d (sess %p)",
|
||||
rc, sess);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((reg->tgt_dev != pr_cmd->tgt_dev) && !dev->tas) {
|
||||
uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN];
|
||||
int sl;
|
||||
sl = scst_set_sense(sense_buffer, sizeof(sense_buffer),
|
||||
dev->d_sense,
|
||||
SCST_LOAD_SENSE(scst_sense_cleared_by_another_ini_UA));
|
||||
/*
|
||||
* Potentially, setting UA here, when the aborted commands are
|
||||
* still running, can lead to a situation that one of them could
|
||||
* take it, then that would be detected and the UA requeued.
|
||||
* But, meanwhile, one or more subsequent, i.e. not aborted,
|
||||
* commands can "leak" executed normally. So, as result, the
|
||||
* UA would be delivered one or more commands "later". However,
|
||||
* that should be OK, because, if multiple commands are being
|
||||
* executed in parallel, you can't control exact order of UA
|
||||
* delivery anyway.
|
||||
*/
|
||||
scst_check_set_UA(reg->tgt_dev, sense_buffer, sl, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
@@ -5687,6 +5687,18 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
list_for_each_entry(tgt_dev, &UA_tgt_devs,
|
||||
extra_tgt_dev_list_entry) {
|
||||
/*
|
||||
* Potentially, setting UA here, when the aborted
|
||||
* commands are still running, can lead to a situation
|
||||
* that one of them could take it, then that would be
|
||||
* detected and the UA requeued. But, meanwhile, one or
|
||||
* more subsequent, i.e. not aborted, commands can
|
||||
* "leak" executed normally. So, as result, the
|
||||
* UA would be delivered one or more commands "later".
|
||||
* However, that should be OK, because, if multiple
|
||||
* commands are being executed in parallel, you can't
|
||||
* control exact order of UA delivery anyway.
|
||||
*/
|
||||
scst_check_set_UA(tgt_dev, sense_buffer, sl, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user