Skip to content
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

rasdaemon: Fix for vendor errors are not recorded in the SQLite datab… #157

Closed

Conversation

shijujose4
Copy link
Contributor

…ase if some cpus are offline

Fix for vendor errors are not recorded in the SQLite database if some cpus are offline at the system start.

Issue:

This issue is reproducible by offline some cpus, run ./rasdaemon -f --record & and
inject vendor specific error supported in the rasdaemon.

Reason:

When the system starts with some of the cpus offline and then run the rasdaemon, read_ras_event_all_cpus() exit with error and switch to the multi thread way. However read() in read_ras_event() return error in threads for each of the offline CPUs and does clean up including calling ras_ns_finalize_vendor_tables(), which invokes sqlite3_finalize() on vendor tables created. Thus the vendor error data does not stored in the SQLite database when such error is reported next time.

Solution:

In ras_ns_add_vendor_tables() and ras_ns_finalize_vendor_tables() use reference count and close vendor tables which created in ras_ns_add_vendor_tables() based on the reference count.

Reported-by: Junhao He [email protected]

…ase if some cpus are offline

Fix for vendor errors are not recorded in the SQLite database if some cpus
are offline at the system start.

Issue:

This issue is reproducible by offline some cpus, run
./rasdaemon -f --record & and
inject vendor specific error supported in the rasdaemon.

Reason:

When the system starts with some of the cpus offline and then run
the rasdaemon, read_ras_event_all_cpus() exit with error and switch to
the multi thread way. However read() in read_ras_event() return error in
threads for each of the offline CPUs and does clean up including calling
ras_ns_finalize_vendor_tables(), which invokes sqlite3_finalize() on vendor
tables created. Thus the vendor error data does not stored in the SQLite
database when such error is reported next time.

Solution:

In ras_ns_add_vendor_tables() and ras_ns_finalize_vendor_tables() use
reference count and close vendor tables which created in ras_ns_add_vendor_tables()
based on the reference count.

Reported-by: Junhao He <[email protected]>
Signed-off-by: Shiju Jose <[email protected]>
@mchehab
Copy link
Owner

mchehab commented Jun 11, 2024

Merged, thanks!

@mchehab mchehab closed this Jun 11, 2024
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