Skip to content

[202311][SSD] Bug fix: the logic to match the vendor specific attribute is not accurate #16

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

Closed
wants to merge 1 commit into from

Conversation

stephenxs
Copy link
Owner

Description

The logic to match the vendor-specific attribute in SSD API is not accurate. The vendor-specific attribute should start with a new line (\n) otherwise it can hit a false match scenario.

Motivation and Context

How Has This Been Tested?

Unit test and manual test

Additional Information (Optional)

Eg. if the raw value of an attribute happens to contain the ID, the next line can be matched but it is wrong.
For example the vendor-specific attribute ID is 248, but the output is like the following:

215 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       4275
231 Unknown_SSD_Attribute   0x1913   100   100   025    Pre-fail  Always       -       100
235 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       1302467136
235 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       1302467248
237 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       0
241 Total_LBAs_Written      0x0012   100   100   000    Old_age   Always       -       1186450104
242 Total_LBAs_Read         0x0012   100   100   000    Old_age   Always       -       2257141451
243 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       0
244 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       0
248 Unknown_Attribute       0x0112   100   100   001    Old_age   Always       -       100

The raw value of attribute 235 contains 248, the next line, which is of attribute 237, will be matched, which is wrong.

@stephenxs
Copy link
Owner Author

ci 4220 passed

@stephenxs stephenxs closed this Jul 9, 2024
@stephenxs stephenxs deleted the 202311_fix_ssd_parse_vendor_id branch August 6, 2024 01:25
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