Bug 245563

Summary: lvmdiskscan misreports volume counts when run in lvm shell
Product: Red Hat Enterprise Linux 5 Reporter: Bryn M. Reeves <bmr>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: agk, dwysocha, jbrassow, mbroz, prockai, pvrabec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2008-0378 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 15:39:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix lvmdiskcan reporting in lvm shell none

Description Bryn M. Reeves 2007-06-25 13:20:32 UTC
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 13:20:34 UTC
Created attachment 157751 [details]
fix lvmdiskcan reporting in lvm shell

Comment 5 RHEL Program Management 2007-10-16 03:56:39 UTC
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-18 00:23:35 UTC
In lvm2-2.02.30-1.el5.

Comment 9 errata-xmlrpc 2008-05-21 15:39:24 UTC
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