Bug 81393 - /proc/partitions contains invalid data (negative values)
/proc/partitions contains invalid data (negative values)
Status: CLOSED DUPLICATE of bug 56602
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
2.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Larry Woodman
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-08 17:01 EST by Chris Bertin
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-09 03:50:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Chris Bertin 2003-01-08 17:01:55 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/782; en-US; rv:1.0.1) Gecko/20020827
Netscape/7.0

Description of problem:
The CDROM data can show negative values for the last three fields as
soon as the CD is mounted. For instance:

major        3
minor        0
blocks       10394
name         hda
rio          189
rmerge       6238
rsect        26062
ruse         23800
wio          0
wmerge       0
wsect        0
wuse         0major        8
minor        0
blocks       17781760
name         sda
rio          1666638
rmerge       46947507
rsect        156365460
ruse         5303350
wio          2376175
wmerge       7503004
wsect        79210122
wuse         107994350
running      -2
use          -158486506
aveq         -1969034562


A raw output of the partition table shows:
# cat /proc/partitions
major minor  #blocks  name     rio rmerge rsect ruse wio wmerge wsect wuse
running use aveq

   8     0   17781760 sda 1666638 46947507 156365460 5303350 2376219 7503069
79210994 107994350 -2 -158452166 -1969103242
   8     1     136521 sda1 126 1483 3218 560 219 206 850 3520 0 3450 4080
   8     2    1052257 sda2 20762 219299 1920482 126470 7330 122053 1035352
3502170 0 111610 3628650
   8     3   16587112 sda3 834105 8728330 76788154 3343010 2368670 7380810
78174792 104488710 1 -578276466 692389826
   3     0      10394 hda 189 6238 26062 23800 0 0 0 0 -136 -66061566 889421676



These values should all be unsigned. Ideally, they should also be
64-bit, even on 32-bit kernels.

These bad values cause our performance tools to report invalid data.


running      -131
use          -66229266
aveq         911412496

The 'aveq' values also typically go down instead of up.

The data for SCSI disks can go negative over time. For instnce:



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. For the CD case, simply mount the CD
2. cat /proc/partitions
3.
    
For the SCSI case, a lot of I/O is required.

Actual Results:  Negative numbers are seen in /proc/partitions

Expected Results:  Only positive numbers should be seen (-100 I/Os in flight
doesn't make sense).

Additional info:
Comment 1 Rhett Butler 2003-06-19 17:36:33 EDT
See Comment #8 in Bug #63977
Comment 3 Larry Woodman 2005-04-04 11:22:41 EDT
This problem has been fixed by this patch:
-----------------------------------------------------------------
--- linux/drivers/block/ll_rw_blk.c.orig
+++ linux/drivers/block/ll_rw_blk.c
@@ -826,11 +826,14 @@ void req_new_io(struct request *req, int
 void req_finished_io(struct request *req)
 {
 	struct hd_struct *hd1, *hd2;
-	locate_hd_struct(req, &hd1, &hd2);
-	if (hd1)
-		account_io_end(hd1, req);
-	if (hd2)	
-		account_io_end(hd2, req);
+
+	if ((req->cmd == READ) || (req->cmd == WRITE)) {
+		locate_hd_struct(req, &hd1, &hd2);
+		if (hd1)
+			account_io_end(hd1, req);
+		if (hd2)	
+			account_io_end(hd2, req);
+	}
 }
 
 /*
Comment 4 Don Howard 2007-07-09 03:50:04 EDT

*** This bug has been marked as a duplicate of 56602 ***

Note You need to log in before you can comment on or make changes to this bug.