Skip to contentSkip to conversation

master - pvresize: fail exit code for negative size

PATCH Zdenek Kabelac 1 participant 1 message Mar 25, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0738f0ad7289cca4121aace1540e479648a1abe2
Commit:        0738f0ad7289cca4121aace1540e479648a1abe2
Parent:        8471fb01d885aab5c46b61602352ca90814f8a8e
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Mar 25 11:52:03 2014 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Mar 25 11:52:03 2014 +0100

pvresize: fail exit code for negative size

Pvresize with negative value retuns invalid cmd line exit code.

---
 WHATS_NEW        |    1 +
 tools/pvresize.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
index a1eb7ed..6926901 100644
@@ -1,5 +1,6 @@
 Version 2.02.106 - 
 ====================================
+  Return failure when specifying negative size for pvresize.
   Fix memory corruption in cmd context refresh if clvmd leaks opened device.
   Reinitialise lvmcache properly on fork to fix premature polldaemon exit.
   Add 'lvm dumpconfig --type diff' to show differences from defaults.
tools/pvresize.c +1 -1
index faf3134..1bb8a15 100644
@@ -52,7 +52,7 @@ int pvresize(struct cmd_context *cmd, int argc, char **argv)
 
 	if (arg_sign_value(cmd, physicalvolumesize_ARG, SIGN_NONE) == SIGN_MINUS) {
 		log_error("Physical volume size may not be negative");
-		return 0;
+		return EINVALID_CMD_LINE;
 	}
 
 	params.new_size = arg_uint64_value(cmd, physicalvolumesize_ARG,