Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 220405

Summary: unable to change the rw permissions of an active cluster mirror
Product: [Retired] Red Hat Cluster Suite Reporter: Corey Marthaler <cmarthal>
Component: cmirrorAssignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: agk, cfeist, dwysocha, jbrassow, mbroz, prockai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-08-05 21:25:02 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
Patch to allow permission changes on active cluster mirrors none

Description Corey Marthaler 2006-12-20 23:47:14 UTC
Description of problem:

I have one linear and one mirror:
[root@link-07 ~]# lvs
  LV    VG            Attr   LSize Origin Snap%  Move Log        Copy%
  lvol0 mirror_4_3659 -wi-a- 1.00G
  lvol1 mirror_4_3659 mwi-a- 1.00G                    lvol1_mlog 100.00

[root@link-07 ~]# lvscan
  ACTIVE            '/dev/mirror_4_3659/lvol0' [1.00 GB] inherit
  ACTIVE            '/dev/mirror_4_3659/lvol1' [1.00 GB] inherit
[root@link-07 ~]# lvchange -pr /dev/mirror_4_3659/lvol0
  Logical volume "lvol0" changed
[root@link-07 ~]# lvchange -pr /dev/mirror_4_3659/lvol1
  Error locking on node link-04: device-mapper: reload ioctl failed: Invalid
argument
  Error locking on node link-02: device-mapper: reload ioctl failed: Invalid
argument
  Error locking on node link-07: device-mapper: reload ioctl failed: Invalid
argument
  Error locking on node link-08: device-mapper: reload ioctl failed: Invalid
argument
  Failed to lock lvol1


Console:
Dec 20 17:56:43 link-07 dmeventd[2917]: Monitoring mirror device,
mirror_4_3659-lvol1 for events
Dec 20 17:57:09 link-07 dmeventd[2917]: mirror_4_3659-lvol1 is now in-sync
Dec 20 18:00:41 link-07 kernel: dm-cmirror: Log already exists with uuid, tonnj7OF
Dec 20 18:00:41 link-07 kernel: device-mapper: dm-mirror: Error creating mirror
dirty log
Dec 20 18:00:41 link-07 kernel: device-mapper: error adding target to table


Version-Release number of selected component (if applicable):
[root@link-07 ~]# rpm -q cmirror
cmirror-1.0.1-0
[root@link-07 ~]# rpm -qa | grep lvm2
lvm2-cluster-debuginfo-2.02.06-7.0.RHEL4
lvm2-cluster-2.02.17-1
lvm2-2.02.17-1
[root@link-07 ~]# uname -ar
Linux link-07 2.6.9-42.17.ELsmp #1 SMP Mon Oct 9 18:42:57 EDT 2006 x86_64 x86_64
x86_64 GNU/Linux

Comment 1 Corey Marthaler 2007-01-04 20:22:16 UTC
FWIW, this works just fine in single mode mirrors.

[root@link-08 ~]# lvscan
  ACTIVE            '/dev/corey/mirror' [100.00 MB] inherit
[root@link-08 ~]# lvs -a -o +devices
  LV                VG    Attr   LSize   Origin Snap%  Move Log         Copy% 
Devices                             
  mirror            corey mwi-a- 100.00M                    mirror_mlog 100.00
mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] corey iwi-ao 100.00M                                      
/dev/sdb1(0)                        
  [mirror_mimage_1] corey iwi-ao 100.00M                                      
/dev/sdc1(0)                        
  [mirror_mlog]     corey lwi-ao   4.00M                                      
/dev/sdh1(0)                        
[root@link-08 ~]# lvchange -pr /dev/corey/mirror
  Logical volume "mirror" changed
[root@link-08 ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/corey/mirror
  VG Name                corey
  LV UUID                pGzHZ7-1Xar-PLTV-cuRb-3hcm-LXOq-p1u3Ry
  LV Write Access        read only
  LV Status              available
  # open                 0
  LV Size                100.00 MB
  Current LE             25
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:5


Comment 3 Jonathan Earl Brassow 2007-01-10 17:27:39 UTC
Not going into RHEL 4.5.

To change permissions on a device mapper device, the table must be reloaded. 
Cluster mirroring prevents reloads of identical tables.  The fix for this would
involve kernel changes (and associated userspace changes) and is not possible
for 4.5.

There is a workaround though.  Deactivate the mirror, change the permissions,
then reactivate.

Also, we can do better in terms of error reporting.  That is something that can
be done for RHEL 4.5.


Comment 4 Jonathan Earl Brassow 2007-01-10 18:14:51 UTC
This is what it prints now.

[root@neo-04 ~]# lvchange -p r vg/lv
  Permissions for mirrored logical volume "lv" cannot be changed while active.


Comment 6 Jonathan Earl Brassow 2007-02-15 16:33:05 UTC
The clearing of bug 228104 has also removed the restrictions on changing
permission while a cluster mirror is active...  There is no more need for the
patch that prevents this action (comment 4).


Comment 7 Jonathan Earl Brassow 2007-03-16 19:26:58 UTC
Created attachment 150272 [details]
Patch to allow permission changes on active cluster mirrors

Comment 8 Corey Marthaler 2007-04-12 18:14:40 UTC
Fix verified in lvm2-cluster-2.02.21-3.el4/cmirror-kernel-2.6.9-30.0. Marking
verified.

Comment 9 Chris Feist 2008-08-05 21:25:02 UTC
Fixing as this bug has been fixed in the latest cmirror release.