Re: [PATCH v5 02/18] btrfs: add new quota mode for simple quotas

Josef Bacik
2023-08-21T18:00:12Z

On Thu, Jul 27, 2023 at 03:12:49PM -0700, Boris Burkov wrote:
> Add a new quota mode called "simple quotas". It can be enabled by the
> existing quota enable ioctl via a new command, and sets an incompat
> bit, as the implementation of simple quotas will make backwards
> incompatible changes to the disk format of the extent tree.
>
> Signed-off-by: Boris Burkov <boris@bur.io>
> ---
> fs/btrfs/delayed-ref.c | 4 +-
> fs/btrfs/fs.h | 5 +-
> fs/btrfs/ioctl.c | 3 +-
> fs/btrfs/qgroup.c | 91 +++++++++++++++++++++++----------
> fs/btrfs/qgroup.h | 4 +-
> fs/btrfs/root-tree.c | 2 +-
> fs/btrfs/transaction.c | 4 +-
> include/uapi/linux/btrfs.h | 2 +
> include/uapi/linux/btrfs_tree.h | 14 ++++-
> 9 files changed, 91 insertions(+), 38 deletions(-)
>
> diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
> index 6a13cf00218b..a9b938d3a531 100644
> --- a/fs/btrfs/delayed-ref.c
> +++ b/fs/btrfs/delayed-ref.c
> @@ -898,7 +898,7 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
> return -ENOMEM;
> }
>
> - if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
> + if (btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_DISABLED &&
> !generic_ref->skip_qgroup) {
> record = kzalloc(sizeof(*record), GFP_NOFS);
> if (!record) {
> @@ -1002,7 +1002,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,
> return -ENOMEM;
> }
>
> - if (test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) &&
> + if (btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_DISABLED &&
> !generic_ref->skip_qgroup) {
> record = kzalloc(sizeof(*record), GFP_NOFS);
> if (!record) {
> diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
> index 203d2a267828..f76f450c2abf 100644
> --- a/fs/btrfs/fs.h
> +++ b/fs/btrfs/fs.h
> @@ -218,7 +218,8 @@ enum {
> BTRFS_FEATURE_INCOMPAT_NO_HOLES | \
> BTRFS_FEATURE_INCOMPAT_METADATA_UUID | \
> BTRFS_FEATURE_INCOMPAT_RAID1C34 | \
> - BTRFS_FEATURE_INCOMPAT_ZONED)
> + BTRFS_FEATURE_INCOMPAT_ZONED | \
> + BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA)
>
> #ifdef CONFIG_BTRFS_DEBUG
> /*
> @@ -233,7 +234,6 @@ enum {
>
> #define BTRFS_FEATURE_INCOMPAT_SUPP \
> (BTRFS_FEATURE_INCOMPAT_SUPP_STABLE)
> -

Extraneous newline change.

> #endif
>
> #define BTRFS_FEATURE_INCOMPAT_SAFE_SET \
> @@ -790,7 +790,6 @@ struct btrfs_fs_info {
> struct lockdep_map btrfs_state_change_map[4];
> struct lockdep_map btrfs_trans_pending_ordered_map;
> struct lockdep_map btrfs_ordered_extent_map;
> -

Same here. Once you fix it up you can add

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef