Skip to content

Commit d4fe468

Browse files
dsharma-dctiagolobocastro
authored andcommitted
fix: check valid sct and sc combinations for pi error
Signed-off-by: Diwakar Sharma <diwakar.sharma@datacore.com>
1 parent 67259ef commit d4fe468

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

io-engine/src/bdev/nvmx/utils.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ pub enum NvmeAerInfoNvmCommandSet {
4040

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

6162
sct == NvmeStatusCodeType::MediaError as u16
62-
|| sc == NvmeMediaErrorStatusCode::Guard as u16
63-
|| sc == NvmeMediaErrorStatusCode::ApplicationTag as u16
64-
|| sc == NvmeMediaErrorStatusCode::ReferenceTag as u16
63+
&& (sc == NvmeMediaErrorStatusCode::Guard as u16
64+
|| sc == NvmeMediaErrorStatusCode::ApplicationTag as u16
65+
|| sc == NvmeMediaErrorStatusCode::ReferenceTag as u16)
6566
}
6667

6768
#[inline]

0 commit comments

Comments
 (0)