From: Christoph Hellwig Date: Fri, 1 Mar 2024 15:28:20 +0000 (-0700) Subject: shared/298: run xfs_db against the loop device instead of the image file X-Git-Tag: v2024.03.17~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=926ae266c86aaf62cdb39e508d22c2ba626e8819;p=xfstests-dev.git shared/298: run xfs_db against the loop device instead of the image file xfs_db fails to properly detect the device sector size and thus segfaults when run again an image file with 4k sector size. While that's something we should fix in xfs_db it will require a fair amount of refactoring of the libxfs init code. For now just change shared/298 to run xfs_db against the loop device created on the image file that is used for I/O, which feels like the right thing to do anyway to avoid cache coherency issues. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Zorro Lang --- diff --git a/tests/shared/298 b/tests/shared/298 index 4c138197..2c86e29f 100755 --- a/tests/shared/298 +++ b/tests/shared/298 @@ -73,7 +73,7 @@ get_free_sectors() agsize=`$XFS_INFO_PROG $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'` # Convert free space (agno, block, length) to (start sector, end sector) $UMOUNT_PROG $loop_mnt - $XFS_DB_PROG -r -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \ + $XFS_DB_PROG -r -c "freesp -d" $loop_dev | $SED_PROG '/^.*from/,$d'| \ $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \ '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }' ;;