• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1FSCK_OPT=-yf
2
3# use current directory instead of /tmp becase tmpfs doesn't support DIO
4rm -f $TMPFILE
5TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
6
7stat -f $TMPFILE | grep -q "Type: tmpfs"
8if [ $? = 0 ] ; then
9	rm -f $TMPFILE
10	echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
11	return 0
12fi
13
14$MKE2FS -q -F -o Linux -b 4096 $TMPFILE 100 > $test_name.log 2>&1
15status=$?
16if [ "$status" != 0 ] ; then
17	echo "mke2fs failed" > $test_name.failed
18	echo "$test_name: $test_description: failed"
19	return $status
20fi
21
22$TUNE2FS -O mmp -E mmp_update_interval=1 $TMPFILE >> $test_name.log 2>&1
23status=$?
24if [ "$status" != 0 ] ; then
25	echo "tune2fs -O mmp failed with $status" > $test_name.failed
26	echo "$test_name: $test_description: failed"
27	return $status
28fi
29
30$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
31status=$?
32if [ "$status" = 0 ] ; then
33	echo "$test_name: $test_description: ok"
34	touch $test_name.ok
35else
36	echo "e2fsck with MMP enabled failed with $status" > $test_name.failed
37	echo "$test_name: $test_description: failed"
38	return $status
39fi
40rm -f $TMPFILE
41