]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/270: Fix syntax error
authorYang Xu <xuyang2018.jy@fujitsu.com>
Tue, 19 Jul 2022 08:31:12 +0000 (16:31 +0800)
committerZorro Lang <zlang@kernel.org>
Sun, 31 Jul 2022 13:36:51 +0000 (21:36 +0800)
Without xfsprogs commit
f4afdcb0a ("xfs_db: clean up the salvage read callsites in set_cur()"),
this case will fail as below:

+/var/lib/xfstests/tests/xfs/270: line 51: [: !=: unary operator expected

With this xfsprogs bug, xfs_db can't get new_ro_compat value, so report
this bash syntax error.

Fix this and add a helper output for xfsprogs bug.

Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/270

index b740c37949919b8ebd503bb1b88eba230b3c5283..7447ce87be79b8ff36e98db0a69cdf76b72029b9 100755 (executable)
@@ -47,8 +47,10 @@ _scratch_xfs_set_metadata_field "features_ro_compat" "$ro_compat" "sb 0" \
 new_ro_compat=$(_scratch_xfs_get_metadata_field "features_ro_compat" "sb 0" \
                                                2>/dev/null)
 
-# verify the new ro_compat field is correct.
-if [ $new_ro_compat != $ro_compat ]; then
+# verify the new ro_compat field is correct. Without xfsprogs commit
+# f4afdcb0ad ("xfs_db: clean up the salvage read callsites in set_cur()"),
+# we can't get new_ro_compat value.
+if [ "$new_ro_compat" != "$ro_compat" ]; then
        echo "Unable to set new features_ro_compat. Wanted $ro_compat, got $new_ro_compat"
 fi