summaryrefslogtreecommitdiff
path: root/test/shell
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2023-01-26 14:00:00 -0600
committerDavid Teigland <teigland@redhat.com>2023-01-26 14:02:20 -0600
commit5374a44c57127cdd832a675545c1d2bbf0b3751a (patch)
tree0da0b2d24235fe1dfa01b3a9c49b5bc339607cda /test/shell
parent8adfcddc35be16ac1d1a00a169ec89a7f12d69af (diff)
downloadlvm2-5374a44c57127cdd832a675545c1d2bbf0b3751a.tar.gz
lvresize: fail early if mounted LV was renamed
If a mounted LV is renamed, then fs resizing utilities will fail, so detect this condition and fail the command before any changes are made.
Diffstat (limited to 'test/shell')
-rw-r--r--test/shell/lvresize-fs.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/shell/lvresize-fs.sh b/test/shell/lvresize-fs.sh
index 0be6911a0..f437652d6 100644
--- a/test/shell/lvresize-fs.sh
+++ b/test/shell/lvresize-fs.sh
@@ -262,6 +262,17 @@ umount "$mount_dir"
lvchange -an $vg/$lv
lvremove $vg/$lv
+# lvextend|lvreduce, ext4, active, mounted, --fs resize, renamed LV
+lvcreate -n $lv -L 256M $vg
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv"
+mount "$DM_DEV_DIR/$vg/$lv" "$mount_dir"
+lvrename $vg/$lv $vg/$lv2
+not lvextend --fs resize -L+32M $vg/$lv2
+not lvreduce --fs resize -L-32M $vg/$lv2
+umount "$mount_dir"
+lvchange -an $vg/$lv2
+lvremove $vg/$lv2
+
#
# lvextend, xfs