diff mbox series

xfs/540: Use _scratch_xfs_set_metadata_field api

Message ID 1632996480-2153-1-git-send-email-xuyang2018.jy@fujitsu.com (mailing list archive)
State New, archived
Headers show
Series xfs/540: Use _scratch_xfs_set_metadata_field api | expand

Commit Message

Yang Xu (Fujitsu) Sept. 30, 2021, 10:08 a.m. UTC
With older xfsprogs, xfs_db write subcmd doesn't -d option. So this case fails.
Use _scratch_xfs_set_metadata_field api to avoid this.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 tests/xfs/540 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/tests/xfs/540 b/tests/xfs/540
index b00b9bcc..55484dd3 100755
--- a/tests/xfs/540
+++ b/tests/xfs/540
@@ -41,11 +41,11 @@  _scratch_unmount
 
 echo "Misconfigure the root directory"
 rtextsz_blks=$((rtextsz / dbsize))
-_scratch_xfs_db -x -c "inode $rootino" \
-	-c "write -d core.extsize $((rtextsz_blks + 1))" \
-	-c 'write -d core.rtinherit 1' \
-	-c 'write -d core.extszinherit 1' \
-	-c 'print' >> $seqres.full
+
+_scratch_xfs_set_metadata_field core.extsize $((rtextsz_blks + 1)) "inode $rootino" >> $seqres.full
+_scratch_xfs_set_metadata_field core.rtinherit 1 "inode $rootino" >> $seqres.full
+_scratch_xfs_set_metadata_field core.extszinherit 1 "inode $rootino" >> $seqres.full
+_scratch_xfs_db -x -c "inode $rootino" -c 'print' >> $seqres.full
 
 echo "Detect misconfigured directory"
 _scratch_xfs_repair -n >> $seqres.full 2>&1 && \