]> granicus.if.org Git - sysstat/commitdiff
iostat incorrectly mapped device-mapper IDs
authorSebastien Godard <sysstat@orange.fr>
Sun, 27 Feb 2011 15:07:59 +0000 (16:07 +0100)
committerSebastien Godard <sysstat@orange.fr>
Sun, 27 Feb 2011 15:07:59 +0000 (16:07 +0100)
greater than 256. This is now fixed [DEBIAN Bug#614397].

Mail from Robert Luberda <robert@debian.org> (22/02/2011)
Subject: Fwd: Bug#614397: iostat(from sysstat) doesn't support more
than 256 device-mapper names

Sebastien,

I'm forwarding a bug report I've got yesterday.
I can't reproduce it by myself, as I don't use LVM at all, but I've just
found out that some Debian machines actually do use it, and the device
numbers on them  starts with 252, so the contents of /dev/mapper looks like:

crw-rw----  1 root root  10, 61 Feb 19 18:43 control
brw-rw----  1 root disk 252,  0 Feb 19 18:43 vg_$hostname-srv

Regards,
robert

------ Wiadomosc oryginalna ------
Temat: Bug#614397: iostat(from sysstat) doesn't support more than 256
device-mapper names
Odeslano-Data: Mon, 21 Feb 2011 18:27:01 +0000, Mon, 21 Feb 2011
18:27:04 +0000
Odeslano-Od: Adam Heath <doogie@brainfood.com>
Odeslano-Do: debian-bugs-dist@lists.debian.org
Odeslano-Kopia: Robert Luberda <robert@debian.org>
Data: Mon, 21 Feb 2011 12:24:11 -0600
Nadawca: Adam Heath <doogie@brainfood.com>
Odpowiedz-Do: Adam Heath <doogie@brainfood.com>, 614397@bugs.debian.org
Adresat: submit@bugs.debian.org

package: sysstat
severity: minor
version: 9.0.6.1-2

iostat tries to do bit-shifting of device ids; this is a big no-no.
Attached patch at least fixes it for mapping of device-mapper
names(iostat -N).

I would love to have this go into stable-updates(squeeze), but can
understand if it's not the type of change that normally would be allowed.

The circumstances of this bug, cause device 256 to map to 0, 257 to
map to 1, etc.

debian-changes-9.0.6.1-2.1

--- sysstat-9.0.6.1.orig/ioconf.c
+++ sysstat-9.0.6.1/ioconf.c
@@ -500,8 +500,8 @@ char *transform_devmapname(unsigned int
  if (stat(filen, &aux) == 0) {
  /* Get its minor and major numbers */

- dm_major = ((aux.st_rdev >> 8) & 0xff);
- dm_minor = (aux.st_rdev & 0xff);
+ dm_major = major(aux.st_rdev);
+ dm_minor = minor(aux.st_rdev);

  if ((dm_minor == minor) && (dm_major == major)) {
  dm_name = dp->d_name;

CHANGES
ioconf.c

diff --git a/CHANGES b/CHANGES
index 7096aa3050f66819304ccc43dad0e2b8ce7dd8ab..ce33abf7bf485e481b02ef6daf872d8291241dc9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,8 @@ xxxx/xx/xx: Version 10.0.0 - Sebastien Godard (sysstat <at> orange.fr)
        * [Jan Kaluza]: Added --debuginfo option to cifsiostat and
          nfsiostat.
        * cifsiostat and nfsiostat manual pages updated.
+       * [Adam Heath]: iostat incorrectly mapped device-mapper IDs
+         greater than 256. This is now fixed [DEBIAN Bug#614397].
        * Sysstat's commands option -V now displays the version number
          on stdout and returns 0 for the exit code.
        * sysstat_panic function is now defined only in DEBUG mode.
index b6b999426fa5805dcddf37e2e36dc6990065b3a8..b38868374cfa854c7427282f4df43ceea3b2b968 100644 (file)
--- a/ioconf.c
+++ b/ioconf.c
@@ -500,8 +500,8 @@ char *transform_devmapname(unsigned int major, unsigned int minor)
                if (stat(filen, &aux) == 0) {
                        /* Get its minor and major numbers */
 
-                       dm_major = ((aux.st_rdev >> 8) & 0xff);
-                       dm_minor = (aux.st_rdev & 0xff);
+                       dm_major = major(aux.st_rdev);
+                       dm_minor = minor(aux.st_rdev);
        
                        if ((dm_minor == minor) && (dm_major == major)) {
                                dm_name = dp->d_name;