Accumulate ReadCount and WriteCount into 64-bit count in devstat

This commit is contained in:
Andrea Mazzoleni 2026-08-16 21:28:28 +02:00
parent caeb3a9d1b
commit a8ffcec127

View file

@ -895,7 +895,9 @@ static int devstat(uint64_t device, const char* name, const char* wfile, uint64_
return -1;
}
*count = ds.ReadCount + ds.WriteCount;
/* accumulate in 64-bit to avoid 32-bit overflow when adding the two DWORD counters */
*count = ds.ReadCount;
*count += ds.WriteCount;
return 0;
}