Bug 245563 - lvmdiskscan misreports volume counts when run in lvm shell
lvmdiskscan misreports volume counts when run in lvm shell
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Broz
Corey Marthaler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-25 09:20 EDT by Bryn M. Reeves
Modified: 2013-02-28 23:05 EST (History)
6 users (show)

See Also:
Fixed In Version: RHBA-2008-0378
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 11:39:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
fix lvmdiskcan reporting in lvm shell (910 bytes, patch)
2007-06-25 09:20 EDT, Bryn M. Reeves
no flags Details | Diff

  None (edit)
Description Bryn M. Reeves 2007-06-25 09:20:32 EDT
Description of problem:
The lvmdiskscan command uses four global counters to track the number of
disks, partitions & PVs located. These are statically initialised to
zero but are never reset between runs.

Normally this doesn't leed to noticable problems but if the command is run
repeatedly inside the lvm shell the counters accumulate between runs:

# lvm
lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  7 disks
  14 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  14 disks
  28 partitions
  0 LVM physical volume whole disks
  2 LVM physical volumes



Version-Release number of selected component (if applicable):
lvm2-2.02.16-3.el5

How reproducible:
100%

Steps to Reproduce:
1. Start the lvm shell:
# lvm

2. Run the lvmdiskscan command:
# lvmdiskscan


Actual results:
Partition, disk & volume counts accumulate across runs:

lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  7 disks
  14 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  14 disks                           <----*
  28 partitions                      <----*
  0 LVM physical volume whole disks  <----*
  2 LVM physical volumes             <----*

Expected results:
Correct counts reported on each invocation:


lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  7 disks
  14 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
lvm> lvmdiskscan
  /dev/ramdisk               [       16.00 MB]
  /dev/loop0                 [      500.00 MB] LVM physical volume
[...]
  7 disks
  14 partitions
  0 LVM physical volume whole disks
  1 LVM physical volume
Comment 1 Bryn M. Reeves 2007-06-25 09:20:34 EDT
Created attachment 157751 [details]
fix lvmdiskcan reporting in lvm shell
Comment 5 RHEL Product and Program Management 2007-10-15 23:56:39 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 6 Milan Broz 2008-01-17 19:23:35 EST
In lvm2-2.02.30-1.el5.
Comment 9 errata-xmlrpc 2008-05-21 11:39:24 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0378.html

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