]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme: use libnvme's atomic ANA log page fetch
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 30 Apr 2024 22:35:01 +0000 (16:35 -0600)
committerDaniel Wagner <wagi@monom.org>
Tue, 25 Jun 2024 15:14:03 +0000 (17:14 +0200)
commit66c1f7046964c4c9b96f1535fa7f0aa6fa391605
tree9fb9f60757c0578641a18e0967e854dea3c080f9
parent34f226c041ae5aa5ca38585cb35815a6dd96a162
nvme: use libnvme's atomic ANA log page fetch

nvme ana-log currently uses libnvme's nvme{,_mi_admin}_get_log_ana()
function to fetch the ANA log page.
As described in the commit adding nvme_get_ana_log_atomic() to libnvme,
this has the potential to overread the ANA log page
and may result in a torn result if the log page changes concurrently.
Use nvme{,_mi_admin}_get_ana_log_atomic() to only fetch up to the end
of the ANA log page and protect against concurrent log page changes.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
nvme-wrap.c
nvme-wrap.h
nvme.c