2014-08-13 11:16:39 +10:00
|
|
|
#! /bin/bash
|
2018-06-09 11:35:45 +10:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
# Copyright (c) 2014 Red Hat Inc. All Rights Reserved.
|
|
|
|
|
#
|
2014-08-13 11:16:39 +10:00
|
|
|
# FS QA Test No. xfs/020
|
|
|
|
|
#
|
|
|
|
|
# Test segfault issue when repairing large xfs.
|
|
|
|
|
#
|
|
|
|
|
# Regression test for xfsprogs commit
|
|
|
|
|
# 7f2d6b8 xfs_repair: avoid segfault if reporting progress early in repair
|
|
|
|
|
#
|
|
|
|
|
seq=`basename $0`
|
|
|
|
|
seqres=$RESULT_DIR/$seq
|
|
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
|
tmp=/tmp/$$
|
|
|
|
|
status=1 # failure is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
cd /
|
|
|
|
|
rm -f $tmp.*
|
2014-09-29 12:56:16 +10:00
|
|
|
rm -f $fsfile
|
2014-08-13 11:16:39 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
|
|
|
|
|
|
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs xfs
|
|
|
|
|
_supported_os Linux
|
|
|
|
|
_require_test
|
|
|
|
|
|
2017-11-02 21:28:02 -07:00
|
|
|
# Writing a 60t fs requires about 2GB of space, so make sure
|
|
|
|
|
# we have plenty of space to do that.
|
|
|
|
|
_require_fs_space $TEST_DIR 2500000
|
|
|
|
|
|
2014-08-13 11:16:39 +10:00
|
|
|
echo "Silence is golden"
|
|
|
|
|
|
2014-09-29 12:56:16 +10:00
|
|
|
fsfile=$TEST_DIR/fsfile.$seq
|
|
|
|
|
rm -f $fsfile
|
2020-02-04 16:01:54 -08:00
|
|
|
# The actual truncate command is required here (and not xfs_io) because it
|
|
|
|
|
# returns nonzero if the operation fails.
|
|
|
|
|
truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."
|
2020-01-15 21:11:19 -08:00
|
|
|
rm -f $fsfile
|
2014-09-29 12:56:16 +10:00
|
|
|
|
|
|
|
|
$MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
|
2015-09-21 13:06:17 +10:00
|
|
|
$XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1
|
2014-08-13 11:16:39 +10:00
|
|
|
|
|
|
|
|
status=$?
|
|
|
|
|
exit
|