When using old xfsprogs, this case fails as below:
+write: invalid option -- 'd'
xfs_db write command support -d options since xfsprogs commit
86769b32d01 ("xfs_db: allow recalculating CRCs on invalid metadata").
For avoid invalid error, use scratch_xfs_set_sb_field api instead.
Also add missing "rm -f $seqres.full" at the beginning of the test.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
# get standard environment, filters and checks
. ./common/rc
. ./common/fuzzy
# get standard environment, filters and checks
. ./common/rc
. ./common/fuzzy
else
echo "mount failed" >> $seqres.full
fi
else
echo "mount failed" >> $seqres.full
fi
- _scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
+ _scratch_xfs_get_sb_field unit >> $seqres.full
+ _scratch_xfs_get_sb_field width >> $seqres.full
# Run xfs_repair in repair mode to see if it can be baited into nuking
# the root filesystem on account of the sunit update.
# Run xfs_repair in repair mode to see if it can be baited into nuking
# the root filesystem on account of the sunit update.
fi
# Update the superblock like the kernel used to do.
fi
# Update the superblock like the kernel used to do.
- _scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
- _scratch_xfs_db -x -c 'sb 0' -c 'write -d unit 256' -c 'write -d width 1024' >> $seqres.full
- _scratch_xfs_db -c 'sb 0' -c 'p unit width' >> $seqres.full
+ _scratch_xfs_get_sb_field unit >> $seqres.full
+ _scratch_xfs_get_sb_field width >> $seqres.full
+ _scratch_xfs_set_sb_field unit 256 >> $seqres.full
+ _scratch_xfs_set_sb_field width 1024 >> $seqres.full
+ _scratch_xfs_get_sb_field unit >> $seqres.full
+ _scratch_xfs_get_sb_field width >> $seqres.full
# Run xfs_repair in repair mode to see if it can be baited into nuking
# the root filesystem on account of the sunit update.
# Run xfs_repair in repair mode to see if it can be baited into nuking
# the root filesystem on account of the sunit update.