]> sourceware.org Git - lvm2.git/commitdiff
Prevent permission changes on active mirrors.
authorAlasdair Kergon <agk@redhat.com>
Wed, 10 Jan 2007 19:56:39 +0000 (19:56 +0000)
committerAlasdair Kergon <agk@redhat.com>
Wed, 10 Jan 2007 19:56:39 +0000 (19:56 +0000)
WHATS_NEW
man/lvconvert.8
tools/lvchange.c

index 80781968c53bda001abc53641a33d02be15aef30..3593f32e50c9b91cf01e965fe0b0b15ea00029e8 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,7 +1,8 @@
 Version 2.02.18 -
 ====================================
-  Print warning instead of error message if cannot zero volume
-  Update lvconvert man page (snapshot option)
+  Prevent permission changes on active mirrors.
+  Print warning instead of error message if lvconvert cannot zero volume.
+  Add snapshot options to lvconvert man page.
   dumpconfig accepts a list of configuration variables to display.
   Change dumpconfig to use --file to redirect output to a file.
   Avoid vgreduce error when mirror code removes the log LV.
index 8efde5991654ce34d26eeca450e0ac79fb39eaab..7ce15bf2470f7868416765de1220e6e9b9264257 100644 (file)
@@ -58,7 +58,7 @@ Power of 2 chunk size for the snapshot logical volume between 4k and 512k.
 .TP
 .I \-Z, \-\-zero y/n
 Controls zeroing of the first KB of data in the snapshot.
-If the volume is read only snapshot will not be zeroed.
+If the volume is read-only the snapshot will not be zeroed.
 .br
 .SH Examples
 "lvconvert -m1 vg00/lvol1"
index 658725fd1a3f35e4536cdc800ff941e07da42597..4f1210080a554036a4c4d00f4504da0590def317 100644 (file)
@@ -19,6 +19,7 @@ static int lvchange_permission(struct cmd_context *cmd,
                               struct logical_volume *lv)
 {
        uint32_t lv_access;
+       struct lvinfo info;
 
        lv_access = arg_uint_value(cmd, permission_ARG, 0);
 
@@ -34,6 +35,13 @@ static int lvchange_permission(struct cmd_context *cmd,
                return 0;
        }
 
+       if ((lv->status & MIRRORED) && (lv->vg->status & CLUSTERED) &&
+           lv_info(cmd, lv, &info, 0) && info.exists) {
+               log_error("Cannot change permissions of mirror \"%s\" "
+                         "while active.", lv->name);
+               return 0;
+       }
+
        if (lv_access & LVM_WRITE) {
                lv->status |= LVM_WRITE;
                log_verbose("Setting logical volume \"%s\" read/write",
This page took 0.040371 seconds and 5 git commands to generate.