[PATCH v3 8/9] overlay: fix test and scratch filters for overlay base fs

Amir Goldstein
2017-02-12T20:44:06Z

When configuring overlay base fs, TEST_DEV/DIR and SCRATCH_DEV/MNT
are derived from the base fs mount points, where *_DEV are the
path of the base fs mount point and TEST_DIR/SCRATCH_MNT are
a directory under the base fs mount point.

This means that the overlay DEV paths are prefixes of the overlay
mount points.
Fix the test and sctach filters to try and match TEST_DIR/SCRATCH_MNT
first and only then try and match the shorter *_DEV.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
common/filter | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/common/filter b/common/filter
index 4328159..ef20ea6 100644
--- a/common/filter
+++ b/common/filter
@@ -280,13 +280,14 @@ _filter_xfs_io_pages_modified()

_filter_test_dir()
{
- sed -e "s,$TEST_DEV,TEST_DEV,g" -e "s,$TEST_DIR,TEST_DIR,g"
+ sed -e "s,$TEST_DIR,TEST_DIR,g" \
+ -e "s,$TEST_DEV,TEST_DEV,g"
}

_filter_scratch()
{
- sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \
- -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \
+ sed -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \
+ -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \
-e "/.use_space/d"
}

--
2.7.4