Test the creation and reading of a large symlink. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- tests/metadata-checksum-test.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/metadata-checksum-test.sh b/tests/metadata-checksum-test.sh index 4e353e1..d34985b 100755 --- a/tests/metadata-checksum-test.sh +++ b/tests/metadata-checksum-test.sh @@ -3277,6 +3277,30 @@ ${E2FSPROGS}/debugfs/debugfs -R 'stat /bigfile' "${DEV}" | grep -c "Size: ${FILE ${E2FSPROGS}/debugfs/debugfs -R 'stat /bigfile2' "${DEV}" | grep -c "Size: ${FILE_SIZE}" } +########################## +function big_symlink_test { +msg "big_symlink_test" + +$VALGRIND ${E2FSPROGS}/misc/mke2fs -T ext4icsum $MKFS_OPTS $MKFS_FEATURES -F "${DEV}" +test -z "$NO_CSUM" && $VALGRIND ${E2FSPROGS}/misc/tune2fs -O metadata_csum $DEV +${E2FSPROGS}/misc/dumpe2fs -h $DEV 2> /dev/null | egrep -q "^Filesystem state:[ ]*clean$" || ${fsck_cmd} -fDy $DEV || true + +set +x +LINK_TARGET="/$(printf "x%.0s" {1..1000})" +set -x +${mount_cmd} ${MOUNT_OPTS} "${DEV}" "${MNT}" -t ext4 -o journal_checksum +ln -s "${LINK_TARGET}" "${MNT}/biglink" +umount "${MNT}" +${E2FSPROGS}/debugfs/debugfs -R 'stat /biglink' "${DEV}" | cat - +${fsck_cmd} -C0 -f -n "${DEV}" + +${mount_cmd} ${MOUNT_OPTS} "${DEV}" "${MNT}" -t ext4 -o journal_checksum +LINK_NOW="$(readlink "${MNT}/biglink")" +umount "${MNT}" + +test "${LINK_NOW}" = "${LINK_TARGET}" +} + # This test should be the last one (before speed tests, anyway) #### ALL SPEED TESTS GO AT THE END -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html