All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/dmthin: Fix grep command for finding exact value
@ 2017-03-16 10:31 Harish
  0 siblings, 0 replies; 4+ messages in thread
From: Harish @ 2017-03-16 10:31 UTC (permalink / raw)
  To: fstests; +Cc: Harish

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

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

diff --git a/common/dmthin b/common/dmthin
index e774175..baab628 100644
--- a/common/dmthin
+++ b/common/dmthin
@@ -178,12 +178,12 @@ _dmthin_grow()
 	local blk_dev_size=`blockdev --getsz $dm_backing_dev`
 
 	# 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    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}'`
+	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    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}'`
 
 	# default to 25% growth
 	if [ -z "$add_sectors" ]; then
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] common/dmthin: Fix grep command for finding exact value
       [not found]   ` <32c10b3d-80a9-cd1d-4abd-8db5f904c381@linux.vnet.ibm.com>
@ 2017-03-16 10:23     ` Eryu Guan
  0 siblings, 0 replies; 4+ messages in thread
From: Eryu Guan @ 2017-03-16 10:23 UTC (permalink / raw)
  To: Harish; +Cc: fstests

On Thu, Mar 16, 2017 at 03:45:14PM +0530, Harish wrote:
> On 03/16/2017 12:54 PM, Eryu Guan wrote:
> 
>     On Thu, Mar 16, 2017 at 10:18:50AM +0530, Harish wrote:
> 
>         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}'`
> 
>     Do we need to do the same to all other $DMTHIN_.*_NAME, not only
>     DMTHIN_DATA_NAME and DMTHIN_POOL_NAME?
> 
> Just added the cases which failed. we may get the issue with others as well.
> Can i resend adding for others?

That'd be great, thanks!

Eryu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] common/dmthin: Fix grep command for finding exact value
  2017-03-16  4:48 Harish
@ 2017-03-16  7:24 ` Eryu Guan
       [not found]   ` <32c10b3d-80a9-cd1d-4abd-8db5f904c381@linux.vnet.ibm.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Eryu Guan @ 2017-03-16  7:24 UTC (permalink / raw)
  To: Harish; +Cc: fstests

On Thu, Mar 16, 2017 at 10:18:50AM +0530, Harish wrote:
> 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}'`

Do we need to do the same to all other $DMTHIN_.*_NAME, not only
DMTHIN_DATA_NAME and DMTHIN_POOL_NAME?

Thanks,
Eryu
>  	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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] common/dmthin: Fix grep command for finding exact value
@ 2017-03-16  4:48 Harish
  2017-03-16  7:24 ` Eryu Guan
  0 siblings, 1 reply; 4+ messages in thread
From: Harish @ 2017-03-16  4:48 UTC (permalink / raw)
  To: fstests; +Cc: Harish

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-16 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 10:31 [PATCH] common/dmthin: Fix grep command for finding exact value Harish
  -- strict thread matches above, loose matches on Subject: below --
2017-03-16  4:48 Harish
2017-03-16  7:24 ` Eryu Guan
     [not found]   ` <32c10b3d-80a9-cd1d-4abd-8db5f904c381@linux.vnet.ibm.com>
2017-03-16 10:23     ` Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.