lvresize: Use --force so it can make LVs smaller (RHBZ#587484).

This also adds a regression test for this bug.
This commit is contained in:
Richard Jones
2010-04-30 10:51:49 +01:00
parent 25c1526125
commit c24de46d06
2 changed files with 9 additions and 2 deletions

View File

@@ -267,7 +267,7 @@ do_lvresize (const char *logvol, int mbytes)
r = command (NULL, &err,
"lvm", "lvresize",
"-L", size, logvol, NULL);
"--force", "-L", size, logvol, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);

View File

@@ -2585,7 +2585,14 @@ are activated or deactivated.");
["e2fsck_f"; "/dev/VG/LV"];
["resize2fs"; "/dev/VG/LV"];
["mount_options"; ""; "/dev/VG/LV"; "/"];
["cat"; "/new"]], "test content")],
["cat"; "/new"]], "test content");
InitNone, Always, TestRun (
(* Make an LV smaller to test RHBZ#587484. *)
[["part_disk"; "/dev/sda"; "mbr"];
["pvcreate"; "/dev/sda1"];
["vgcreate"; "VG"; "/dev/sda1"];
["lvcreate"; "LV"; "VG"; "20"];
["lvresize"; "/dev/VG/LV"; "10"]])],
"resize an LVM logical volume",
"\
This resizes (expands or shrinks) an existing LVM logical