Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 81393 - /proc/partitions contains invalid data (negative values)
Summary: /proc/partitions contains invalid data (negative values)
Keywords:
Status: CLOSED DUPLICATE of bug 56602
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel
Version: 2.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Larry Woodman
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-08 22:01 UTC by Chris Bertin
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-09 07:50:04 UTC


Attachments (Terms of Use)

Description Chris Bertin 2003-01-08 22:01:55 UTC
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 21:36:33 UTC
See Comment #8 in Bug #63977

Comment 3 Larry Woodman 2005-04-04 15:22:41 UTC
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 07:50:04 UTC

*** 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.