public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o
@ 2013-07-02 21:44 Koen De Wit
  2013-07-24 23:09 ` Ben Myers
  2013-08-15 16:33 ` Rich Johnston
  0 siblings, 2 replies; 3+ messages in thread
From: Koen De Wit @ 2013-07-02 21:44 UTC (permalink / raw)
  To: xfs; +Cc: Koen De Wit

If multiple mount options are given with multiple -o parameters,
_mount_ops_filter concatenates them by replacing all -o's with a comma
(except for the first -o).

If $TEST_DIR contains "-o" (e.g. /mnt/test-os/) you get errors like this:

   # ./check generic/002
     mount: mount point /mnt/test,s/ does not exist
     common/rc: retrying test device mount with external set
     mount: mount point /mnt/test,s/ does not exist
     common/rc: could not mount /dev/sdc3 on /mnt/test-os/

Fix it by only replacing -o's that are preceded by at least one space.

Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>
---
 common/rc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/rc b/common/rc
index fe6bbfc..2a3c040 100644
--- a/common/rc
+++ b/common/rc
@@ -260,7 +260,7 @@ _mount_ops_filter()
     # the sed script replaces all -o's (except the first) with a comma
     # not required for linux, but won't hurt
     
-    echo $params | sed -e 's/[[:space:]]*-o[[:space:]]*/UnIqUe/1; s/[[:space:]]*-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
+    echo $params | sed -e 's/[[:space:]]\+-o[[:space:]]*/UnIqUe/1; s/[[:space:]]\+-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
         | sed -e 's/dmapi/dmi/' \
         | $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$FS_ESCAPED\1\2#; print;"
 
-- 
1.7.2.5

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o
  2013-07-02 21:44 [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o Koen De Wit
@ 2013-07-24 23:09 ` Ben Myers
  2013-08-15 16:33 ` Rich Johnston
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Myers @ 2013-07-24 23:09 UTC (permalink / raw)
  To: Koen De Wit; +Cc: xfs

On Tue, Jul 02, 2013 at 11:44:57PM +0200, Koen De Wit wrote:
> If multiple mount options are given with multiple -o parameters,
> _mount_ops_filter concatenates them by replacing all -o's with a comma
> (except for the first -o).
> 
> If $TEST_DIR contains "-o" (e.g. /mnt/test-os/) you get errors like this:
> 
>    # ./check generic/002
>      mount: mount point /mnt/test,s/ does not exist
>      common/rc: retrying test device mount with external set
>      mount: mount point /mnt/test,s/ does not exist
>      common/rc: could not mount /dev/sdc3 on /mnt/test-os/
> 
> Fix it by only replacing -o's that are preceded by at least one space.
> 
> Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>

Reviewed-by: Ben Myers <bpm@sgi.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o
  2013-07-02 21:44 [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o Koen De Wit
  2013-07-24 23:09 ` Ben Myers
@ 2013-08-15 16:33 ` Rich Johnston
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Johnston @ 2013-08-15 16:33 UTC (permalink / raw)
  To: Koen De Wit; +Cc: xfs

On 07/02/2013 04:44 PM, Koen De Wit wrote:
> If multiple mount options are given with multiple -o parameters,
> _mount_ops_filter concatenates them by replacing all -o's with a comma
> (except for the first -o).
>
> If $TEST_DIR contains "-o" (e.g. /mnt/test-os/) you get errors like this:
>
>     # ./check generic/002
>       mount: mount point /mnt/test,s/ does not exist
>       common/rc: retrying test device mount with external set
>       mount: mount point /mnt/test,s/ does not exist
>       common/rc: could not mount /dev/sdc3 on /mnt/test-os/
>
> Fix it by only replacing -o's that are preceded by at least one space.
>
> Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>
> ---
>   common/rc |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index fe6bbfc..2a3c040 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -260,7 +260,7 @@ _mount_ops_filter()
>       # the sed script replaces all -o's (except the first) with a comma
>       # not required for linux, but won't hurt
>
> -    echo $params | sed -e 's/[[:space:]]*-o[[:space:]]*/UnIqUe/1; s/[[:space:]]*-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
> +    echo $params | sed -e 's/[[:space:]]\+-o[[:space:]]*/UnIqUe/1; s/[[:space:]]\+-o[[:space:]]*/,/g; s/UnIqUe/ -o /1' \
>           | sed -e 's/dmapi/dmi/' \
>           | $PERL_PROG -ne "s#mtpt=[^,|^\n|^\s]*#mtpt=$FS_ESCAPED\1\2#; print;"
>
>
Sorry Koen I did not see this had been reviewed, thanks for the patch.
It has been committed.

--Rich

commit 74357dea4a975d2942163a2df7a527b57c46650b
Author: Koen De Wit <koen.de.wit@oracle.com>
Date:   Tue Jul 2 21:44:57 2013 +0000

     xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2013-08-15 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-02 21:44 [PATCH] xfstests: fix _mount_ops_filter() to support $TEST_DIR containing -o Koen De Wit
2013-07-24 23:09 ` Ben Myers
2013-08-15 16:33 ` Rich Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox