Skip to content

Commit

Permalink
common/quota: Make project quota handling work for ext2 & ext3
Browse files Browse the repository at this point in the history
Project quota can work for ext2 & ext3 the same way as for ext4.
Handle them properly as currently the tests just fail because of
unknown prjquota mount option. After this patch, tests will be "not
run" because ext4 driver refuses to use project quota mount options
for "old" fs types.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
  • Loading branch information
jankara authored and guaneryu committed May 16, 2018
1 parent 5018cd1 commit b2bffe5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions common/quota
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ _require_xfs_quota_foreign()
_require_prjquota()
{
[ -n "$1" ] && _dev="$1" || _dev="$TEST_DEV"
if [ "$FSTYP" == "ext4" ]; then
if [[ "$FSTYP" == ext[234] ]]; then
dumpe2fs -h $_dev 2>&1 | grep -qw project || \
_notrun "Project quota not available on this ext4"
_notrun "Project quota not available on this $FSTYP"
fi
src/feature -P $_dev
[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
Expand All @@ -116,7 +116,7 @@ _require_getnextquota()
# prior to mount. This is a relatively new feature ...
_scratch_enable_pquota()
{
[ "$FSTYP" != "ext4" ] && return
[[ "$FSTYP" != ext[234] ]] && return

tune2fs -O quota,project $SCRATCH_DEV >>$seqres.full 2>&1
_try_scratch_mount >/dev/null 2>&1 \
Expand Down Expand Up @@ -242,7 +242,7 @@ _qmount_option()

# ext4 doesn't _do_ "-o pquota/prjquota" because reasons
# Switch it to "quota" to enable mkfs-time pquota
if [ "$FSTYP" == "ext4" ]; then
if [[ "$FSTYP" == ext[234] ]]; then
OPTS=`echo $OPTS \
| sed -e 's/\bpquota/quota/g' \
-e 's/prjquota/quota/g'`
Expand Down

0 comments on commit b2bffe5

Please sign in to comment.