Skip to content

Commit e279153

Browse files
mayastor-borsdsharma-dc
mayastor-bors
andcommitted
Merge #1756
1756: fix: check valid sct and sc combinations for pi error r=dsharma-dc a=dsharma-dc Fix the sct and sc combination checks. Don't see a reason why it would be valid as it stands today. This just floods the logs as we might log io completion as PI error, for unrelated status code values too. spdk handles the PI error as per this modified check. Co-authored-by: Diwakar Sharma <diwakar.sharma@datacore.com>
2 parents a2a75d9 + 7d98138 commit e279153

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)