e2fsprogs/tests/t_project_4off/script
Wang shilong 245831ad9a tune2fs: fix BUGs of tuning project quota
There are several problems for project quota enable/disable:
tune2fs -O ^project did not work, because @clear_ok_features
did not include @EXT4_FEATURE_RO_COMPAT_PROJECT.

update_feature_set() works for -O option, but tune2fs -Q prj/^prj
did not work well, because function handle_quota_options()
did not set and clear @EXT4_FEATURE_RO_COMPAT_PROJECT feature very well.

one warning message is removed, because with project feature
enabled, quota feature will be enabled automatically.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-29 20:41:54 -04:00

36 lines
878 B
Plaintext

FSCK_OPT=-yf
if [ "$QUOTA" != "y" ]; then
echo "$test_name: $test_description: skipped"
return 0
fi
$MKE2FS -q -F -o Linux -I 256 -b 4096 -O quota,project $TMPFILE 100 > $test_name.log 2>&1
status=$?
if [ "$status" != 0 ] ; then
echo "mke2fs -O quota,project failed" > $test_name.failed
echo "$test_name: $test_description: failed"
return $status
fi
$TUNE2FS -Q ^prj $TMPFILE >> $test_name.log 2>&1
status=$?
if [ "$status" != 0 ] ; then
echo "tune2fs -O ^project failed" > $test_name.failed
echo "$test_name: $test_description: failed"
return $status
fi
$FSCK $FSCK_OPT $TMPFILE >> $test_name.log 2>&1
status=$?
if [ "$status" = 0 ] ; then
echo "$test_name: $test_description: ok"
touch $test_name.ok
else
echo "e2fsck with project enabled failed with $status" > $test_name.failed
echo "$test_name: $test_description: failed"
return $status
fi
rm -f $TMPFILE