[PATCH] common/dmthin: Fix grep command for finding exact value

Harish
2017-03-16T04:49:51Z

Sometimes there are multiple occurences of pool_name and data_name in
dmsetup command which causes failures while adding in next line.
This patch greps for pool_name at start of line.

Signed-off-by: Harish <harish@linux.vnet.ibm.com>
---
common/dmthin | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/dmthin b/common/dmthin
index e774175..fe48eef 100644
--- a/common/dmthin
+++ b/common/dmthin
@@ -180,8 +180,8 @@ _dmthin_grow()
# Get current sizes & values
local meta_dev_size=`$DMSETUP_PROG table | grep $DMTHIN_META_NAME | awk '{print $3}'`
local meta_dev_offset=`$DMSETUP_PROG table | grep $DMTHIN_META_NAME | awk '{print $6}'`
- local data_dev_size=`$DMSETUP_PROG table | grep $DMTHIN_DATA_NAME | awk '{print $3}'`
- local pool_dev_size=`$DMSETUP_PROG table | grep $DMTHIN_POOL_NAME | awk '{print $3}'`
+ local data_dev_size=`$DMSETUP_PROG table | grep ^$DMTHIN_DATA_NAME | awk '{print $3}'`
+ local pool_dev_size=`$DMSETUP_PROG table | grep ^$DMTHIN_POOL_NAME | awk '{print $3}'`
local cluster_size=`$DMSETUP_PROG table | grep $DMTHIN_POOL_NAME | awk '{print $7}'`
local low_water=`$DMSETUP_PROG table | grep $DMTHIN_POOL_NAME | awk '{print $8}'`

--
2.7.4