Skip to contentSkip to conversation

[2.4] Fix negative diskstats

RFC PATCH New Mike Fedyk 1 participant 1 message Dec 30, 2003 Block layer

lore
Share & tools
lore

Mike Fedyk

author
#0 lore raw

RFC PATCH 1/1 [2.4] Fix negative diskstats

Hi,

I noticed that my diskstats were reporting negative numbers, and after a hint from Andreas Dilger I found the problem.

The variables are unsigned int, but they're being reported as signed in proc.

block/genhd.c renamed from block/genhd.c.orig +1 -1
@@ -201,7 +201,7 @@
 
 			disk_round_stats(hd);
 			seq_printf(s, "%4d  %4d %10d %s "
-				      "%d %d %d %d %d %d %d %d %d %d %d\n",
+				      "%u %u %u %u %u %u %u %u %u %u %u\n",
 				      gp->major, n, gp->sizes[n],
 				      disk_name(gp, n, buf),
 				      hd->rd_ios, hd->rd_merges,