openEuler-Storage / libatasmart

libatasmart: a lean, small and clean implementation of an ATA S.M.A.R.T. reading and parsing library.
http://0pointer.de/blog/projects/being-smart.html
0 stars 1 forks source link

Miscalculation of lbas read/written #1

Open lixiaokeng opened 3 years ago

lixiaokeng commented 3 years ago

libatasmart/atasmart.c Line 1225 in de62589 a->pretty_value = fourtyeight * 65536LLU * 512LLU / 1000000LLU; This line seems does lbas-read/written 65536 512 (sectors) / 1000000 (mb). However on my various varieties of Samsung ssd this 65536 multiple is incorrect, it should actually just be 512 / 1000000 to get mb. This means I'm having to put a 16 factor in to convert to bytes/sec

upstream issue link: https://github.com/Rupan/libatasmart/issues/5#issue-651106469

lixiaokeng commented 3 years ago

Now I have no SSamsung ssd. This isuue need some time to verify.