Bug 186104 - kernel dm mirror: lvs Copy% overs 100% by lvreduce/lvresize.
kernel dm mirror: lvs Copy% overs 100% by lvreduce/lvresize.
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Earl Brassow
Depends On:
Blocks: 181409 186476
  Show dependency treegraph
Reported: 2006-03-21 12:36 EST by Kiyoshi Ueda
Modified: 2013-04-02 19:51 EDT (History)
6 users (show)

See Also:
Fixed In Version: RHSA-2006-0575
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 18:51:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to fix problem (1.06 KB, patch)
2006-03-21 17:31 EST, Jonathan Earl Brassow
no flags Details | Diff
Patch to fix problem (1.06 KB, patch)
2006-03-22 10:02 EST, Jonathan Earl Brassow
no flags Details | Diff

  None (edit)
Description Kiyoshi Ueda 2006-03-21 12:36:14 EST
Description of problem:
"Copy%" information of 'lvs' overs 100% after lvreduce/lvresize.

Version-Release number of selected component:
lvm2-2.02.02-1.0.RHEL4 (Technical Preview Version)

How reproducible:
Always at certain resize

Steps to Reproduce:
 1. Prepare some PVs (more than 2) and create VG from them.
      - /dev/sda, /dev/sdb, /dev/sdc as PVs
      - vg0 contains these 3 PVs
 2. Create a mirror LV from the VG.
      # lvcreate -L 52M -n lv0 -m 1 vg0
 3. Deactivate the mirror LV and reduce the size.
      # lvchange -an vg0/lv0
      # lvreduce -L 40M vg0/lv0
 4. Re-activate the mirror LV.
      # lvchange -ay vg0/lv0
 5. Check the "Copy%" of 'lvs' and sync status of 'dmsetup status'.
      # lvs vg0/lv0
      # dmsetup status vg0-lv0

Actual results:
The "Copy%" of lvs is "130.00".
The sync status of 'dmsetup status' is "104/80".

Expected results:
The "Copy%" of lvs should be "100.00".
The sync status of 'dmsetup status' should be "80/80".

Additional info:
Comment 1 Jonathan Earl Brassow 2006-03-21 16:44:08 EST
Yeah, this is a problem for me too.  Mine actually shrinks a bit in size though:

[root@tng1-1 ~]# lvs vg/lv ; dmsetup status vg-lv
  LV   VG   Attr   LSize  Origin Snap%  Move Log     Copy%
  lv   vg   mwi-a- 52.00M                    lv_mlog 100.00
0 106496 mirror 2 253:3 253:4 104/104 1 AA 3 disk 253:2 A
[root@tng1-1 ~]# lvchange -an vg/lv ; lvreduce -L 40M vg/lv; lvchange -ay vg/lv
  Reducing logical volume lv to 40.00 MB
  Logical volume lv successfully resized
[root@tng1-1 ~]# lvs vg/lv ; dmsetup status vg-lv
  LV   VG   Attr   LSize  Origin Snap%  Move Log     Copy%
  lv   vg   mwi-a- 40.00M                    lv_mlog 120.00
0 81920 mirror 2 253:3 253:4 96/80 1 AA 3 disk 253:2 A

Not sure if this is user-space, kernel-space, or both yet...
Comment 2 Jonathan Earl Brassow 2006-03-21 16:49:32 EST
looks like kernel problem because the table line looks good...
Comment 3 Jonathan Earl Brassow 2006-03-21 17:06:01 EST
The problem is with the bitsets.  If you resize down to 32*region_size*n, it
works just fine.  Otherwise, the bits left at the end of the 32-bit field are
counted and the maximum count is surpassed.

Comment 4 Jonathan Earl Brassow 2006-03-21 17:31:18 EST
Created attachment 126440 [details]
Patch to fix problem

I still have to test this patch.
Comment 5 Jonathan Earl Brassow 2006-03-22 10:02:15 EST
Created attachment 126478 [details]
Patch to fix problem

Was clearing wrong bitset.  This one has been tested/verified.
Comment 7 Jonathan Earl Brassow 2006-04-01 15:38:49 EST
This is an issue with the kernel no user-space.  Involves how the log device is
Comment 8 Jason Baron 2006-05-04 13:31:06 EDT
committed in stream U4 build 35.1. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/
Comment 12 Red Hat Bugzilla 2006-08-10 18:51:53 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.


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