]> www.infradead.org Git - users/mchehab/rasdaemon.git/commit
rasdaemon: Fix for vendor errors are not recorded in the SQLite database if some...
authorShiju Jose <shiju.jose@huawei.com>
Wed, 20 Mar 2024 12:16:05 +0000 (12:16 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 11 Jun 2024 09:54:37 +0000 (11:54 +0200)
commitada6a43ae39b38d8e724c37777d4b7c47b48c1db
tree18045d8684c4cc13e0f262f30bf84f8ede7a08ea
parent7ed2da7aedf8bc8ad4c4efe7acbda60ba061be6e
rasdaemon: Fix for vendor errors are not recorded in the SQLite database 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 <hejunhao3@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-non-standard-handler.c
ras-non-standard-handler.h