[PATCH 25/35] fsadm: Allow to specify size without "size=" prefix in "resize"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For backwards compatibility we should allow to specify plain number as a
new size in resize command.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 scripts/fsadm.sh |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 55b4688..f354fec 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -587,9 +587,12 @@ resize() {
 			continue
 		fi
 		case $i in
-			"size=+"*) [ $size -eq 0 ] && extend=${i##*+} && size=1;;
-			"size=-"*) [ $size -eq 0 ] && shrink=${i##*-} && size=1;;
-			"size="*)  [ $size -eq 0 ] && new_size=${i##*=} && size=1;;
+			"size=+"*)	[ $size -eq 0 ] && extend=${i##*+} && size=1;;
+			+[[:digit:]]*)	[ $size -eq 0 ] && extend=${i##*+} && size=1;;
+			"size=-"*)	[ $size -eq 0 ] && shrink=${i##*-} && size=1;;
+			-[[:digit:]]*)	[ $size -eq 0 ] && shrink=${i##*-} && size=1;;
+			"size="*) 	[ $size -eq 0 ] && new_size=${i##*=} && size=1;;
+			[[:digit:]]*) 	[ $size -eq 0 ] && new_size=${i} && size=1;;
 			*) error "Wrong option $i. (see: $TOOL --help)";;
 		esac
 	done
-- 
1.7.4.4

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux