2 # XFS specific common functions.
10 [ "$LARGE_SCRATCH_DEV" != yes ] && return 0
11 [ -z "$SCRATCH_DEV_EMPTY_SPACE" ] && SCRATCH_DEV_EMPTY_SPACE=0
12 [ $SCRATCH_DEV_EMPTY_SPACE -ge $fs_size ] && return 0
14 # calculate the size of the file we need to allocate.
15 # Default free space in the FS is 50GB, but you can specify more via
16 # SCRATCH_DEV_EMPTY_SPACE
17 file_size=$(($fs_size - 50*1024*1024*1024))
18 file_size=$(($file_size - $SCRATCH_DEV_EMPTY_SPACE))
20 # mount the filesystem, create the file, unmount it
21 _try_scratch_mount 2>&1 >$tmp_dir/mnt.err
23 if [ $status -ne 0 ]; then
25 cat $tmp_dir/mnt.err >&2
26 rm -f $tmp_dir/mnt.err
29 rm -f $tmp_dir/mnt.err
32 -c "truncate $file_size" \
33 -c "falloc -k 0 $file_size" \
35 $SCRATCH_MNT/.use_space 2>&1 > /dev/null
36 export NUM_SPACE_FILES=1
39 if [ $status -ne 0 ]; then
40 echo "large file prealloc failed"
41 cat $tmp_dir/mnt.err >&2
47 _scratch_mkfs_xfs_opts()
51 # remove metadata related mkfs options if mkfs.xfs doesn't them
52 if [ -n "$XFS_MKFS_HAS_NO_META_SUPPORT" ]; then
53 mkfs_opts=`echo $mkfs_opts | sed "s/-m\s\+\S\+//g"`
58 echo "$MKFS_XFS_PROG $SCRATCH_OPTIONS $mkfs_opts"
62 _scratch_mkfs_xfs_supported()
68 $MKFS_XFS_PROG -N $MKFS_OPTIONS $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV
71 # a mkfs failure may be caused by conflicts between $MKFS_OPTIONS and
72 # $mkfs_opts, try again without $MKFS_OPTIONS
73 if [ $mkfs_status -ne 0 -a -n "$mkfs_opts" ]; then
74 $MKFS_XFS_PROG -N $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV
82 local mkfs_cmd="`_scratch_mkfs_xfs_opts`"
83 local mkfs_filter="sed -e '/less than device physical sector/d' \
84 -e '/switching to logical sector/d' \
85 -e '/Default configuration/d'"
89 _scratch_do_mkfs "$mkfs_cmd" "$mkfs_filter" $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
92 grep -q crc=0 $tmp.mkfsstd && _force_xfsv4_mount_options
94 if [ $mkfs_status -eq 0 -a "$LARGE_SCRATCH_DEV" = yes ]; then
95 # manually parse the mkfs output to get the fs size in bytes
97 fs_size=`cat $tmp.mkfsstd | perl -ne '
98 if (/^data\s+=\s+bsize=(\d+)\s+blocks=(\d+)/) {
100 print STDOUT "$size\n";
102 _setup_large_xfs_fs $fs_size
106 # output mkfs stdout and stderr
109 rm -f $tmp.mkfserr $tmp.mkfsstd
114 # xfs_check script is planned to be deprecated. But, we want to
115 # be able to invoke "xfs_check" behavior in xfstests in order to
116 # maintain the current verification levels.
121 USAGE="Usage: xfs_check [-fsvV] [-l logdev] [-i ino]... [-b bno]... special"
124 while getopts "b:fi:l:stvV" c; do
129 i) OPTS=$OPTS"-i "$OPTARG" ";;
130 b) OPTS=$OPTS"-b "$OPTARG" ";;
131 f) DBOPTS=$DBOPTS" -f";;
132 l) DBOPTS=$DBOPTS" -l "$OPTARG" ";;
133 V) $XFS_DB_PROG -p xfs_check -V
141 1) ${XFS_DB_PROG}${DBOPTS} -F -i -p xfs_check -c "check$OPTS" $1
151 _scratch_xfs_db_options()
154 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
155 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
156 echo $SCRATCH_OPTIONS $* $SCRATCH_DEV
161 $XFS_DB_PROG "$@" $(_scratch_xfs_db_options)
164 _scratch_xfs_logprint()
167 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
168 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
169 $XFS_LOGPRINT_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
175 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
176 TEST_OPTIONS="-l$TEST_LOGDEV"
177 $XFS_LOGPRINT_PROG $TEST_OPTIONS $* $TEST_DEV
183 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
184 SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
185 [ "$LARGE_SCRATCH_DEV" = yes ] && \
186 SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -t"
187 _xfs_check $SCRATCH_OPTIONS $* $SCRATCH_DEV
190 _scratch_xfs_repair()
193 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
194 SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV"
195 [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
196 SCRATCH_OPTIONS=$SCRATCH_OPTIONS" -r$SCRATCH_RTDEV"
197 $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
200 # this test requires the projid32bit feature to be available in mkfs.xfs.
202 _require_projid32bit()
204 _scratch_mkfs_xfs_supported -i projid32bit=1 >/dev/null 2>&1 \
205 || _notrun "mkfs.xfs doesn't have projid32bit feature"
208 _require_projid16bit()
210 _scratch_mkfs_xfs_supported -i projid32bit=0 >/dev/null 2>&1 \
211 || _notrun "16 bit project IDs not supported on $SCRATCH_DEV"
214 # this test requires the crc feature to be available in mkfs.xfs
216 _require_xfs_mkfs_crc()
218 _scratch_mkfs_xfs_supported -m crc=1 >/dev/null 2>&1 \
219 || _notrun "mkfs.xfs doesn't have crc feature"
222 # this test requires the xfs kernel support crc feature
226 _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
227 _try_scratch_mount >/dev/null 2>&1 \
228 || _notrun "Kernel doesn't support crc feature"
232 # this test requires the xfs kernel support crc feature on scratch device
234 _require_scratch_xfs_crc()
236 _scratch_mkfs_xfs >/dev/null 2>&1
237 _try_scratch_mount >/dev/null 2>&1 \
238 || _notrun "Kernel doesn't support crc feature"
239 $XFS_INFO_PROG $SCRATCH_MNT | grep -q 'crc=1' || _notrun "crc feature not supported by this filesystem"
243 # this test requires the finobt feature to be available in mkfs.xfs
245 _require_xfs_mkfs_finobt()
247 _scratch_mkfs_xfs_supported -m crc=1,finobt=1 >/dev/null 2>&1 \
248 || _notrun "mkfs.xfs doesn't have finobt feature"
251 # this test requires the xfs kernel support finobt feature
253 _require_xfs_finobt()
255 _scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1
256 _try_scratch_mount >/dev/null 2>&1 \
257 || _notrun "Kernel doesn't support finobt feature"
261 # this test requires xfs sysfs attribute support
268 if [ ! -e $sysfsdir ]; then
269 _notrun "no kernel support for XFS sysfs attributes"
272 if [ ! -z $1 ] && [ ! -e $sysfsdir/$attr ]; then
273 _notrun "sysfs attribute '$attr' is not supported"
277 # this test requires the xfs sparse inode feature
279 _require_xfs_sparse_inodes()
281 _scratch_mkfs_xfs_supported -m crc=1 -i sparse > /dev/null 2>&1 \
282 || _notrun "mkfs.xfs does not support sparse inodes"
283 _scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1
284 _try_scratch_mount >/dev/null 2>&1 \
285 || _notrun "kernel does not support sparse inodes"
289 # check that xfs_db supports a specific command
290 _require_xfs_db_command()
292 if [ $# -ne 1 ]; then
293 echo "Usage: _require_xfs_db_command command" 1>&2
298 _scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
299 _notrun "xfs_db $command support is missing"
302 # Does the filesystem mounted from a particular device support scrub?
303 _supports_xfs_scrub()
305 local mountpoint="$1"
308 if [ -z "$device" ] || [ -z "$mountpoint" ]; then
309 echo "Usage: _supports_xfs_scrub mountpoint device"
313 if [ ! -b "$device" ] || [ ! -e "$mountpoint" ]; then
317 test "$FSTYP" = "xfs" || return 1
318 test -x "$XFS_SCRUB_PROG" || return 1
320 # Probe for kernel support...
321 $XFS_IO_PROG -c 'help scrub' 2>&1 | grep -q 'types are:.*probe' || return 1
322 $XFS_IO_PROG -c "scrub probe" "$mountpoint" 2>&1 | grep -q "Inappropriate ioctl" && return 1
324 # Scrub can't run on norecovery mounts
325 _fs_options "$device" | grep -q "norecovery" && return 1
330 # run xfs_check and friends on a FS.
331 _check_xfs_filesystem()
333 if [ $# -ne 3 ]; then
334 echo "Usage: _check_xfs_filesystem device <logdev>|none <rtdev>|none" 1>&2
338 extra_mount_options=""
342 if [ -f $device ]; then
346 if [ "$2" != "none" ]; then
347 extra_log_options="-l$2"
348 extra_mount_options="-ologdev=$2"
351 if [ "$3" != "none" ]; then
352 extra_rt_options="-r$3"
353 extra_mount_options=$extra_mount_options" -ortdev=$3"
355 extra_mount_options=$extra_mount_options" $MOUNT_OPTIONS"
357 [ "$FSTYP" != xfs ] && return 0
359 type=`_fs_type $device`
362 # Run online scrub if we can.
363 mntpt="$(_is_dev_mounted $device)"
364 if [ -n "$mntpt" ] && _supports_xfs_scrub "$mntpt" "$device"; then
365 "$XFS_SCRUB_PROG" $scrubflag -v -d -n $mntpt > $tmp.scrub 2>&1
366 if [ $? -ne 0 ]; then
367 _log_err "_check_xfs_filesystem: filesystem on $device failed scrub"
368 echo "*** xfs_scrub $scrubflag -v -d -n output ***" >> $seqres.full
369 cat $tmp.scrub >> $seqres.full
370 echo "*** end xfs_scrub output" >> $serqres.full
376 if [ "$type" = "xfs" ]; then
378 mountpoint=`_umount_or_remount_ro $device`
381 $XFS_LOGPRINT_PROG -t $extra_log_options $device 2>&1 \
382 | tee $tmp.logprint | grep -q "<CLEAN>"
383 if [ $? -ne 0 -a "$HOSTOS" = "Linux" ]; then
384 _log_err "_check_xfs_filesystem: filesystem on $device has dirty log"
385 echo "*** xfs_logprint -t output ***" >>$seqres.full
386 cat $tmp.logprint >>$seqres.full
387 echo "*** end xfs_logprint output" >>$seqres.full
392 # xfs_check runs out of memory on large files, so even providing the test
393 # option (-t) to avoid indexing the free space trees doesn't make it pass on
394 # large filesystems. Avoid it.
395 if [ "$LARGE_SCRATCH_DEV" != yes ]; then
396 _xfs_check $extra_log_options $device 2>&1 > $tmp.fs_check
398 if [ -s $tmp.fs_check ]; then
399 _log_err "_check_xfs_filesystem: filesystem on $device is inconsistent (c)"
400 echo "*** xfs_check output ***" >>$seqres.full
401 cat $tmp.fs_check >>$seqres.full
402 echo "*** end xfs_check output" >>$seqres.full
407 $XFS_REPAIR_PROG -n $extra_options $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
408 if [ $? -ne 0 ]; then
409 _log_err "_check_xfs_filesystem: filesystem on $device is inconsistent (r)"
410 echo "*** xfs_repair -n output ***" >>$seqres.full
411 cat $tmp.repair >>$seqres.full
412 echo "*** end xfs_repair output" >>$seqres.full
416 rm -f $tmp.fs_check $tmp.logprint $tmp.repair
418 # Optionally test the index rebuilding behavior.
419 if [ -n "$TEST_XFS_REPAIR_REBUILD" ]; then
420 $XFS_REPAIR_PROG $extra_options $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
421 if [ $? -ne 0 ]; then
422 _log_err "_check_xfs_filesystem: filesystem on $device is inconsistent (rebuild)"
423 echo "*** xfs_repair output ***" >>$seqres.full
424 cat $tmp.repair >>$seqres.full
425 echo "*** end xfs_repair output" >>$seqres.full
431 $XFS_REPAIR_PROG -n $extra_options $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1
432 if [ $? -ne 0 ]; then
433 _log_err "_check_xfs_filesystem: filesystem on $device is inconsistent (rebuild-reverify)"
434 echo "*** xfs_repair -n output ***" >>$seqres.full
435 cat $tmp.repair >>$seqres.full
436 echo "*** end xfs_repair output" >>$seqres.full
443 if [ $ok -eq 0 ]; then
444 echo "*** mount output ***" >>$seqres.full
445 _mount >>$seqres.full
446 echo "*** end mount output" >>$seqres.full
447 elif [ "$type" = "xfs" ]; then
448 _mount_or_remount_rw "$extra_mount_options" $device $mountpoint
451 if [ $ok -eq 0 ]; then
453 if [ "$iam" != "check" ]; then
466 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_LOGDEV" ] && \
467 TEST_LOG="$TEST_LOGDEV"
469 [ "$USE_EXTERNAL" = yes -a ! -z "$TEST_RTDEV" ] && \
470 TEST_RT="$TEST_RTDEV"
472 _check_xfs_filesystem $TEST_DEV $TEST_LOG $TEST_RT
476 _require_xfs_test_rmapbt()
480 if [ "$($XFS_INFO_PROG "$TEST_DIR" | grep -c "rmapbt=1")" -ne 1 ]; then
481 _notrun "rmapbt not supported by test filesystem type: $FSTYP"
485 _require_xfs_scratch_rmapbt()
489 _scratch_mkfs > /dev/null
491 if [ "$($XFS_INFO_PROG "$SCRATCH_MNT" | grep -c "rmapbt=1")" -ne 1 ]; then
493 _notrun "rmapbt not supported by scratch filesystem type: $FSTYP"
515 $XFS_IO_PROG -c "bmap -${param}lpv" "$file" | grep -c "$@"
518 # Reset all xfs error handling attributes, set them to original
521 # Only one argument, and it's mandatory:
522 # - dev: device name, e.g. $SCRATCH_DEV
524 # Note: this function only works for XFS
525 _reset_xfs_sysfs_error_handling()
529 if [ ! -b "$dev" -o "$FSTYP" != "xfs" ]; then
530 _fail "Usage: reset_xfs_sysfs_error_handling <device>"
533 _set_fs_sysfs_attr $dev error/fail_at_unmount 1
534 echo -n "error/fail_at_unmount="
535 _get_fs_sysfs_attr $dev error/fail_at_unmount
537 # Make sure all will be configured to retry forever by default, except
538 # for ENODEV, which is an unrecoverable error, so it will be configured
539 # to not retry on error by default.
540 for e in default EIO ENOSPC; do
541 _set_fs_sysfs_attr $dev \
542 error/metadata/${e}/max_retries -1
543 echo -n "error/metadata/${e}/max_retries="
544 _get_fs_sysfs_attr $dev error/metadata/${e}/max_retries
546 _set_fs_sysfs_attr $dev \
547 error/metadata/${e}/retry_timeout_seconds 0
548 echo -n "error/metadata/${e}/retry_timeout_seconds="
549 _get_fs_sysfs_attr $dev \
550 error/metadata/${e}/retry_timeout_seconds
554 # Skip if we are running an older binary without the stricter input checks.
555 # Make multiple checks to be sure that there is no regression on the one
556 # selected feature check, which would skew the result.
558 # At first, make a common function that runs the tests and returns
559 # number of failed cases.
560 _xfs_mkfs_validation_check()
562 local tmpfile=`mktemp`
563 local cmd="$MKFS_XFS_PROG -f -N -d file,name=$tmpfile,size=1g"
565 $cmd -s size=8s >/dev/null 2>&1
568 $cmd -l version=2,su=260k >/dev/null 2>&1
575 # Skip the test if all calls passed - mkfs accepts invalid input
576 _require_xfs_mkfs_validation()
578 _xfs_mkfs_validation_check
579 if [ "$?" -eq 0 ]; then
580 _notrun "Requires newer mkfs with stricter input checks: the oldest supported version of xfsprogs is 4.7."
584 # The opposite of _require_xfs_mkfs_validation.
585 _require_xfs_mkfs_without_validation()
587 _xfs_mkfs_validation_check
588 if [ "$?" -ne 0 ]; then
589 _notrun "Requires older mkfs without strict input checks: the last supported version of xfsprogs is 4.5."
593 # XFS ability to change UUIDs on V5/CRC filesystems
597 # This will create a crc fs on $SCRATCH_DEV
600 _scratch_xfs_db -x -c "uuid restore" 2>&1 \
601 | grep -q "invalid UUID\|supported on V5 fs" \
602 && _notrun "Userspace doesn't support meta_uuid feature"
604 _scratch_xfs_db -x -c "uuid generate" >/dev/null 2>&1
606 _try_scratch_mount >/dev/null 2>&1 \
607 || _notrun "Kernel doesn't support meta_uuid feature"
611 # this test requires mkfs.xfs have case-insensitive naming support
612 _require_xfs_mkfs_ciname()
614 _scratch_mkfs_xfs_supported -n version=ci >/dev/null 2>&1 \
615 || _notrun "need case-insensitive naming support in mkfs.xfs"
618 # XFS_DEBUG requirements
621 if grep -q "debug 0" /proc/fs/xfs/stat; then
622 _notrun "Require XFS built with CONFIG_XFS_DEBUG"
625 _require_no_xfs_debug()
627 if grep -q "debug 1" /proc/fs/xfs/stat; then
628 _notrun "Require XFS built without CONFIG_XFS_DEBUG"
632 # Require that assertions will not crash the system.
634 # Assertions would always crash the system if XFS assert fatal was enabled
635 # (CONFIG_XFS_ASSERT_FATAL=y). If a test is designed to trigger an assertion,
636 # skip the test on a CONFIG_XFS_ASSERT_FATAL built XFS by default. Note:
637 # CONFIG_XFS_ASSERT_FATAL can be disabled by setting bug_on_assert to zero if
638 # we want test to run.
639 _require_no_xfs_bug_on_assert()
641 if [ -f /sys/fs/xfs/debug/bug_on_assert ]; then
642 grep -q "1" /sys/fs/xfs/debug/bug_on_assert && \
643 _notrun "test requires XFS bug_on_assert to be off, turn it off to run the test"
645 # Note: Prior to the creation of CONFIG_XFS_ASSERT_FATAL (and
646 # the sysfs knob bug_on_assert), assertions would always crash
647 # the system if XFS debug was enabled (CONFIG_XFS_DEBUG=y). If
648 # a test is designed to trigger an assertion and the test
649 # designer does not want to hang fstests, skip the test.
650 _require_no_xfs_debug
654 # Get a metadata field
655 # The first arg is the field name
656 # The rest of the arguments are xfs_db commands to find the metadata.
657 _scratch_xfs_get_metadata_field()
662 local grep_key="$(echo "${key}" | tr '[]()' '....')"
666 cmds+=("-c" "${arg}")
668 _scratch_xfs_db "${cmds[@]}" -c "print ${key}" | grep "^${grep_key}" | \
672 # Set a metadata field
673 # The first arg is the field name
674 # The second arg is the new value
675 # The rest of the arguments are xfs_db commands to find the metadata.
676 _scratch_xfs_set_metadata_field()
685 cmds+=("-c" "${arg}")
689 _scratch_xfs_db -x -c "help write" | egrep -q "(-c|-d)" && value="-- ${value}"
690 _scratch_xfs_db -x -c "help write" | egrep -q "(-d)" && wr_cmd="${wr_cmd} -d"
691 _scratch_xfs_db -x "${cmds[@]}" -c "${wr_cmd} ${key} ${value}"
694 _scratch_xfs_get_sb_field()
696 _scratch_xfs_get_metadata_field "$1" "sb 0"
699 _scratch_xfs_set_sb_field()
701 _scratch_xfs_set_metadata_field "$1" "$2" "sb 0"
704 # Before xfsprogs commit 4222d000ed("db: write via array indexing doesn't
705 # work"), xfs_db command to write a specific AGFL index doesn't work. It's a
706 # bug in a diagnostic tool that is only used by XFS developers as a test
707 # infrastructure, so it's fine to treat it as a infrastructure dependency as
708 # all other _require rules.
709 _require_xfs_db_write_array()
714 touch $TEST_DIR/$seq.img
715 $MKFS_XFS_PROG -d file,name=$TEST_DIR/$seq.img,size=512m >/dev/null 2>&1
716 $XFS_DB_PROG -x -c "agfl 0" -c "write bno[32] 78" $TEST_DIR/$seq.img \
718 $XFS_DB_PROG -x -c "agfl 0" -c "print bno[32]" $TEST_DIR/$seq.img \
719 | grep -q "bno\[32\] = 78" && supported=1
720 rm -f $TEST_DIR/$seq.img
721 [ $supported -eq 0 ] && _notrun "xfs_db write can't support array"
724 _require_xfs_spaceman_command()
727 echo "Usage: _require_xfs_spaceman_command command [switch]" 1>&2
733 local param_checked=0
736 _require_command "$XFS_SPACEMAN_PROG" "xfs_spaceman"
738 testfile=$TEST_DIR/$$.xfs_spaceman
741 testio=`$XFS_SPACEMAN_PROG -c "help $command" $TEST_DIR 2>&1`
744 rm -f $testfile 2>&1 > /dev/null
745 echo $testio | grep -q "not found" && \
746 _notrun "xfs_spaceman $command support is missing"
747 echo $testio | grep -q "Operation not supported" && \
748 _notrun "xfs_spaceman $command failed (old kernel/wrong fs?)"
749 echo $testio | grep -q "Invalid" && \
750 _notrun "xfs_spaceman $command failed (old kernel/wrong fs/bad args?)"
751 echo $testio | grep -q "foreign file active" && \
752 _notrun "xfs_spaceman $command not supported on $FSTYP"
753 echo $testio | grep -q "Function not implemented" && \
754 _notrun "xfs_spaceman $command support is missing (missing syscall?)"
756 [ -n "$param" ] || return
758 if [ $param_checked -eq 0 ]; then
759 $XFS_SPACEMAN_PROG -c "help $command" | grep -q "^ $param --" || \
760 _notrun "xfs_spaceman $command doesn't support $param"
764 _scratch_get_sfdir_prefix() {
767 for prefix in "u.sfdir3" "u.sfdir2" "u3.sfdir3"; do
768 if [ -n "$(_scratch_xfs_get_metadata_field \
769 "${prefix}.hdr.parent.i4" \
770 "inode ${dir_ino}")" ]; then
775 _scratch_xfs_db -c "inode ${dir_ino}" -c 'p' >> $seqres.full
779 _scratch_get_bmx_prefix() {
782 for prefix in "u3.bmx" "u.bmx"; do
783 if [ -n "$(_scratch_xfs_get_metadata_field \
784 "${prefix}[0].startblock" \
785 "inode ${ino}")" ]; then
790 _scratch_xfs_db -c "inode ${ino}" -c 'p' >> $seqres.full
795 # Ensures that we don't pass any mount options incompatible with XFS v4
797 _force_xfsv4_mount_options()
802 # Can't have group and project quotas in XFS v4
803 echo "$MOUNT_OPTIONS" | egrep -q "(gquota|grpquota|grpjquota=|gqnoenforce)" && gquota=1
804 echo "$MOUNT_OPTIONS" | egrep -q "(\bpquota|prjquota|pqnoenforce)" && pquota=1
806 if [ $gquota -gt 0 ] && [ $pquota -gt 0 ]; then
807 export MOUNT_OPTIONS=$(echo $MOUNT_OPTIONS \
808 | sed -e 's/gquota/QUOTA/g' \
809 -e 's/grpquota/QUOTA/g' \
810 -e 's/grpjquota=[^, ]/QUOTA/g' \
811 -e 's/gqnoenforce/QUOTA/g' \
812 -e "s/QUOTA/defaults/g")
814 echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full