Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checking if task is in outqueue #398

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Conversation

anatoliy-glagolev
Copy link
Contributor

@anatoliy-glagolev anatoliy-glagolev commented Sep 20, 2023

Libiscsi users need a way to check if a task is queued to send (not sent yet) before invoking functions such as iscsi_task_mgmt_abort_task_async. Otherwise, because task management requests are automatically treated as "immediate", a request to abort a task is sent before the task itself.

if (iscsi_scsi_is_task_in_outqueue(iscsi_, task_)) {
iscsi_scsi_cancel_task(iscsi_, task_);
} else {
iscsi_task_mgmt_abort_task_async(iscsi_, task_, AbortCb, context_);
}

Users need to check if a task is queued to send (not sent yet)
before invoking functions such as iscsi_task_mgmt_abort_task_async.
Otherwise, because task management requests are automatically
treated as "immediate", a request to abort a task is sent before
the task itself.

if (iscsi_scsi_is_task_in_outqueue(iscsi_, task_)) {
    iscsi_scsi_cancel_task(iscsi_, task_);
} else {
    iscsi_task_mgmt_abort_task_async(iscsi_, task_, AbortCb, context_);
}
@sahlberg sahlberg merged commit 528a386 into sahlberg:master Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants