All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] fstests: help user to troubleshoot the re-mount issue quickly
@ 2016-01-09  3:54 Jia He
  2016-01-09  3:54 ` [PATCH V2 1/2] fstests: add user friendly prompts for already mounted points name Jia He
  2016-01-09  3:54 ` [PATCH V2 2/2] fstests: canonicalize the mount points by removing the trailing "/" Jia He
  0 siblings, 2 replies; 3+ messages in thread
From: Jia He @ 2016-01-09  3:54 UTC (permalink / raw)
  To: fstests; +Cc: eguan, Jia He

When I tried to fix a mount issue of tests/xfs/003 failure, I found the
root cause is my mistake that I added "/" to the end of TEST_DIR, eg.
export TEST_DIR=/root/xfstests/test/
This patch set is to let user find the correct cause quickly.

V2: Instead of adding comments, remove all trailing "/"s by readlink.
This is suggested by Eryu Guan.

Jia He (2):
  fstests: add user friendly prompts for already mounted point name
  fstests: canonicalize the mount points by removing the trailing "/"

 common/config | 5 +++++
 common/rc     | 8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

-- 
2.1.4


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

* [PATCH V2 1/2] fstests: add user friendly prompts for already mounted points name
  2016-01-09  3:54 [PATCH V2 0/2] fstests: help user to troubleshoot the re-mount issue quickly Jia He
@ 2016-01-09  3:54 ` Jia He
  2016-01-09  3:54 ` [PATCH V2 2/2] fstests: canonicalize the mount points by removing the trailing "/" Jia He
  1 sibling, 0 replies; 3+ messages in thread
From: Jia He @ 2016-01-09  3:54 UTC (permalink / raw)
  To: fstests; +Cc: eguan, Jia He

This adds user friendly prompts to output the already mounted point from _mount.
xfstests will do the cleanup (ie. umount) and user can not get the mount name
information.

Signed-off-by: Jia He <hejianet@gmail.com>
---
 common/rc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index d33e3fb..f0caef2 100644
--- a/common/rc
+++ b/common/rc
@@ -1271,7 +1271,9 @@ _require_scratch_nocheck()
         # if it's mounted, make sure its on $SCRATCH_MNT
         if ! _mount | grep -F $SCRATCH_DEV | grep -q $SCRATCH_MNT
         then
-            echo "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
+            echo "\$SCRATCH_DEV=$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT=$SCRATCH_MNT - aborting"
+            echo "Already mounted result:"
+            _mount | grep -F $SCRATCH_DEV
             exit 1
         fi
         # and then unmount it
@@ -1353,7 +1355,9 @@ _require_test()
         # if it's mounted, make sure its on $TEST_DIR
         if ! _mount | grep -F $TEST_DEV | grep -q $TEST_DIR
         then
-            echo "\$TEST_DEV is mounted but not on \$TEST_DIR - aborting"
+            echo "\$TEST_DEV=$TEST_DEV is mounted but not on \$TEST_DIR=$TEST_DIR - aborting"
+            echo "Already mounted result:"
+            _mount | grep -F $TEST_DEV
             exit 1
         fi
     else
-- 
2.1.4


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

* [PATCH V2 2/2] fstests: canonicalize the mount points by removing the trailing "/"
  2016-01-09  3:54 [PATCH V2 0/2] fstests: help user to troubleshoot the re-mount issue quickly Jia He
  2016-01-09  3:54 ` [PATCH V2 1/2] fstests: add user friendly prompts for already mounted points name Jia He
@ 2016-01-09  3:54 ` Jia He
  1 sibling, 0 replies; 3+ messages in thread
From: Jia He @ 2016-01-09  3:54 UTC (permalink / raw)
  To: fstests; +Cc: eguan, Jia He

removing all the trailing "/"s of mounting point name by readlink

Suggested-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Jia He <hejianet@gmail.com>
---
 common/config | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/config b/common/config
index e82d279..cb34fd7 100644
--- a/common/config
+++ b/common/config
@@ -551,5 +551,10 @@ if [ -z "$CONFIG_INCLUDED" ]; then
 	[ -z "$FSCK_OPTIONS" ] && _fsck_opts
 fi
 
+# canonicalize the mount points
+# this follows symlinks and removes all trailing "/"s
+export TEST_DIR=`readlink -e "$TEST_DIR"`
+export SCRATCH_MNT=`readlink -e "$SCRATCH_MNT"`
+
 # make sure this script returns success
 /bin/true
-- 
2.1.4


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

end of thread, other threads:[~2016-01-09  3:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-09  3:54 [PATCH V2 0/2] fstests: help user to troubleshoot the re-mount issue quickly Jia He
2016-01-09  3:54 ` [PATCH V2 1/2] fstests: add user friendly prompts for already mounted points name Jia He
2016-01-09  3:54 ` [PATCH V2 2/2] fstests: canonicalize the mount points by removing the trailing "/" Jia He

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.