Re: [PATCH v4 2/6] btrfs: quota mode helpers

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 29/09/2023 07:16, Boris Burkov wrote:
To facilitate skipping tests depending on the qgroup mode after mkfs,
add support for figuring out the mode. This cannot just rely on the new
sysfs file, since it might not be present on older kernels.

Signed-off-by: Boris Burkov <boris@xxxxxx>

Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>


Nits Applied locally.

+_require_scratch_qgroup()
+{
+	_scratch_mkfs >>$seqres.full 2>&1
+	_scratch_mount
+	_run_btrfs_util_prog quota enable $SCRATCH_MNT

Some time ago, we stopped using _run_btrfs_util_prog() in favor of
$BTRFS_UTIL_PROG. The idea is that any errors are printed to stdout,
which is good. However, $BTRFS_UTIL_PROG has a drawback: it doesn't
print the command used, as run_check() does.



+	_check_regular_qgroup $SCRATCH_DEV || _notrun "not running normal qgroups"
+	_scratch_unmount
+}
+
+_require_scratch_enable_simple_quota()
+{
+	_scratch_mkfs >>$seqres.full 2>&1
+	_scratch_mount
+	_qgroup_mode $SCRATCH_DEV | grep 'squota' && _notrun "cannot enable simple quota; on by default"
+	$BTRFS_UTIL_PROG quota enable --simple $SCRATCH_MNT || _notrun "simple quotas not available"
+	_scratch_unmount
+}

Fixed lines above 80 chars long.

Thanks, Anand



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux