Re: [PATCH v5 18/18] btrfs: only set QUOTA_ENABLED when done reading qgroups

Josef Bacik
2023-08-21T18:16:53Z

On Thu, Jul 27, 2023 at 03:13:05PM -0700, Boris Burkov wrote:
> In open_ctree, we set BTRFS_FS_QUOTA_ENABLED as soon as we see a
> quota_root, as opposed to after we are done setting up the qgroup
> structures. In the quota_enable path, we wait until after the structures
> are set up. Likewise, in disable, we clear the bit before tearing down
> the structures. I feel that this organization is less surprising for the
> open_ctree path.
>
> I don't believe this fixes any actual bug, but avoids potential
> confusion when using btrfs_qgroup_mode in an intermediate state where we
> are enabled but haven't yet setup the qgroup status flags. It also
> avoids any risk of calling a qgroup function and attempting to use the
> qgroup rbtrees before they exist/are setup.
>
> This all occurs before we do rw setup, so I believe it should be mostly
> a no-op.
>
> Signed-off-by: Boris Burkov <boris@bur.io>

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

Thanks,

Josef