Skip to content

Commit

Permalink
fix: check valid sct and sc combinations for pi error
Browse files Browse the repository at this point in the history
Signed-off-by: Diwakar Sharma <[email protected]>
  • Loading branch information
dsharma-dc committed Oct 15, 2024
1 parent a2a75d9 commit 7d98138
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions io-engine/src/bdev/nvmx/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ pub enum NvmeAerInfoNvmCommandSet {

/// Check if the Completion Queue Entry indicates abnormal termination of
/// request due to any of the following conditions:
/// - Any media specific errors that occur in the NVM or data integrity type
/// errors.
/// - An Status Code Type(SCT) of media specific errors that occur in the NVM
/// or data integrity type errors, AND a Status Code(SC) value pertaining to
/// one of the below:
/// - The command was aborted due to an end-to-end guard check failure.
/// - The command was aborted due to an end-to-end application tag check
/// failure.
Expand All @@ -59,9 +60,9 @@ pub(crate) fn nvme_cpl_is_pi_error(cpl: *const spdk_nvme_cpl) -> bool {
}

sct == NvmeStatusCodeType::MediaError as u16
|| sc == NvmeMediaErrorStatusCode::Guard as u16
|| sc == NvmeMediaErrorStatusCode::ApplicationTag as u16
|| sc == NvmeMediaErrorStatusCode::ReferenceTag as u16
&& (sc == NvmeMediaErrorStatusCode::Guard as u16
|| sc == NvmeMediaErrorStatusCode::ApplicationTag as u16
|| sc == NvmeMediaErrorStatusCode::ReferenceTag as u16)
}

#[inline]
Expand Down

0 comments on commit 7d98138

Please sign in to comment.