Several tests uses both _filter_test_dir and _filter_scratch concatenated by pipe to filter $TEST_DIR and $SCRATCH_MNT. However, this would fail if the shorter string is a substring of the other (like "/mnt" and "/mnt2"). This patch introduces new common filter function to safely call both _filter_test_dir and _filter_scratch, and update tests and functions to use this new function. I checked this with btrfs/029, generic/409,410,411, and generic/381,383, xfs/106,108 (which calls _filter_quota). Thanks Eryu for advice. [eguan: folded 2nd patch into 1st patch and update commit log a bit] Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>