-
Notifications
You must be signed in to change notification settings - Fork 664
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
plugins/ocp: Use structure for ocp smart log #2604
base: master
Are you sure you want to change the base?
Conversation
plugins/ocp/ocp-smart-extended-log.h
Outdated
* @log_page_version: Log page version | ||
* @log_page_guid: Log page GUID | ||
*/ | ||
struct __packed ocp_smart_extended_log { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you don't use __packed then you don't need to cast them for le64_to_cpu. The __packed attribute removes the natural alignment guarantees and that's why the compiler complains.
Anyway, I like where this is going!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review.
I found out, after I read your review, there are few type cast I forgot to remove.
removed and uptaed.
since we need the __packed as below, I didn't remove type cast from inside of le64_to_cpu
packed = 512
remove packed = 520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the size increase because of the outer alignment? Could you post the output of pahole? Or did the spec screw this up? The __packed
attribute should really be avoided if possible. It hides a lot of bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice I hope he doesn't get bothered by us here and can enjoy it! :)
Cool, so the __packed is not needed, this is what it what I hoped for. This will allow the compiler to report unaligned access etc.
I'll go ahead with #2577 and wait for an update here. No hurry though, so if you don't have time on your hands don't worry.
0a3fbb7
to
5603264
Compare
I've merged #2577, so this one needs a rebase. Thanks! |
66b3b6b
to
744994b
Compare
printed log tested (same), except below Remove wrong duplicated prints from stdout NVMe base errata version NVMe command set errata version Signed-off-by: Steven Seungcheol Lee <[email protected]>
1b03f68
to
b7a4dd9
Compare
Hi @igaw I rebased it. Thanks! |
If the dssd point, minor version are declared as __le16, the alignment will be broken. Remove __packed keyword. Change parameter void to ocp_smart_extended_log. Reported-by: Steven Seungcheol Lee <[email protected]> Signed-off-by: Minsik Jeon <[email protected]>
printed log tested (same), except below
Remove wrong duplicated prints from stdout
NVMe base errata version
NVMe command set errata version