[PATCH] tgt-setup-lun: fix error when blocksize not given

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

 



A prev commit added option for blocksize but intorudced a bug
when user didn't provide a value.

Signed-off-by: Roi Dayan <roid@xxxxxxxxxxxx>
---
 scripts/tgt-setup-lun | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/tgt-setup-lun b/scripts/tgt-setup-lun
index f875b40..8983f10 100755
--- a/scripts/tgt-setup-lun
+++ b/scripts/tgt-setup-lun
@@ -281,7 +281,10 @@ if [ $bs_type ]; then
 	echo "Setting backing store type: $bs_type"
 	bs_opt="-E $bs_type"
 fi
-$TGTADM --lld $lld_name --op new --mode logicalunit --tid $tid --lun $lun --blocksize $block_size -b $dev $bs_opt
+if [ $block_size ]; then
+	blksize_opt="--blocksize $block_size"
+fi
+$TGTADM --lld $lld_name --op new --mode logicalunit --tid $tid --lun $lun -b $dev $bs_opt $blksize_opt
 res=$?
 
 if [ $res -ne 0 ]; then
-- 
1.8.4.3

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux