diff mbox series

[v5,04/18] btrfs: add simple_quota incompat feature to sysfs

Message ID f3aa781253502054034c839ab0d0b18ec35a3d3d.1690495785.git.boris@bur.io (mailing list archive)
State New, archived
Headers show
Series btrfs: simple quotas | expand

Commit Message

Boris Burkov July 27, 2023, 10:12 p.m. UTC
Add an entry in the features directory for the new incompat flag

Signed-off-by: Boris Burkov <boris@bur.io>
---
 fs/btrfs/sysfs.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Josef Bacik Aug. 21, 2023, 6:01 p.m. UTC | #1
On Thu, Jul 27, 2023 at 03:12:51PM -0700, Boris Burkov wrote:
> Add an entry in the features directory for the new incompat flag
> 
> Signed-off-by: Boris Burkov <boris@bur.io>

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

Thanks,

Josef
David Sterba Sept. 7, 2023, 11:28 a.m. UTC | #2
On Thu, Jul 27, 2023 at 03:12:51PM -0700, Boris Burkov wrote:
> Add an entry in the features directory for the new incompat flag
> 
> Signed-off-by: Boris Burkov <boris@bur.io>
> ---
>  fs/btrfs/sysfs.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index e53614753391..f62bba0068ca 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -291,6 +291,7 @@ BTRFS_FEAT_ATTR_INCOMPAT(metadata_uuid, METADATA_UUID);
>  BTRFS_FEAT_ATTR_COMPAT_RO(free_space_tree, FREE_SPACE_TREE);
>  BTRFS_FEAT_ATTR_COMPAT_RO(block_group_tree, BLOCK_GROUP_TREE);
>  BTRFS_FEAT_ATTR_INCOMPAT(raid1c34, RAID1C34);
> +BTRFS_FEAT_ATTR_INCOMPAT(simple_quota, SIMPLE_QUOTA);

I'm not sure if you mentioned in the cover letter or if we had discussed
it before, but does this need to be a full incompat bit? I.e. no mount
on older kernels, compared to a COMPAT_RO which would allow
read-only mount.

>  #ifdef CONFIG_BLK_DEV_ZONED
>  BTRFS_FEAT_ATTR_INCOMPAT(zoned, ZONED);
>  #endif
> @@ -322,6 +323,7 @@ static struct attribute *btrfs_supported_feature_attrs[] = {
>  	BTRFS_FEAT_ATTR_PTR(free_space_tree),
>  	BTRFS_FEAT_ATTR_PTR(raid1c34),
>  	BTRFS_FEAT_ATTR_PTR(block_group_tree),
> +	BTRFS_FEAT_ATTR_PTR(simple_quota),
>  #ifdef CONFIG_BLK_DEV_ZONED
>  	BTRFS_FEAT_ATTR_PTR(zoned),
>  #endif
> -- 
> 2.41.0
Boris Burkov Sept. 7, 2023, 8:56 p.m. UTC | #3
On Thu, Sep 07, 2023 at 01:28:25PM +0200, David Sterba wrote:
> On Thu, Jul 27, 2023 at 03:12:51PM -0700, Boris Burkov wrote:
> > Add an entry in the features directory for the new incompat flag
> > 
> > Signed-off-by: Boris Burkov <boris@bur.io>
> > ---
> >  fs/btrfs/sysfs.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> > index e53614753391..f62bba0068ca 100644
> > --- a/fs/btrfs/sysfs.c
> > +++ b/fs/btrfs/sysfs.c
> > @@ -291,6 +291,7 @@ BTRFS_FEAT_ATTR_INCOMPAT(metadata_uuid, METADATA_UUID);
> >  BTRFS_FEAT_ATTR_COMPAT_RO(free_space_tree, FREE_SPACE_TREE);
> >  BTRFS_FEAT_ATTR_COMPAT_RO(block_group_tree, BLOCK_GROUP_TREE);
> >  BTRFS_FEAT_ATTR_INCOMPAT(raid1c34, RAID1C34);
> > +BTRFS_FEAT_ATTR_INCOMPAT(simple_quota, SIMPLE_QUOTA);
> 
> I'm not sure if you mentioned in the cover letter or if we had discussed
> it before, but does this need to be a full incompat bit? I.e. no mount
> on older kernels, compared to a COMPAT_RO which would allow
> read-only mount.

Unfortunately, as it is, simple quotas does need a full incompat bit.
That is because of the details of how the kernel parses inline refs, but
essentially that code relies on item size being fully exhausted by an
iteration that steps forward by hard-code-computed inline ref size
chunks. That parsing code blows up on the new structures in a way that
can't be fixed, as far as I can tell.

To be COMPAT_RO, we would need to introduce an entirely new item. We
discussed this in one of the early discussions and concluded that was
not worth the space cost compared to an inline item.

> 
> >  #ifdef CONFIG_BLK_DEV_ZONED
> >  BTRFS_FEAT_ATTR_INCOMPAT(zoned, ZONED);
> >  #endif
> > @@ -322,6 +323,7 @@ static struct attribute *btrfs_supported_feature_attrs[] = {
> >  	BTRFS_FEAT_ATTR_PTR(free_space_tree),
> >  	BTRFS_FEAT_ATTR_PTR(raid1c34),
> >  	BTRFS_FEAT_ATTR_PTR(block_group_tree),
> > +	BTRFS_FEAT_ATTR_PTR(simple_quota),
> >  #ifdef CONFIG_BLK_DEV_ZONED
> >  	BTRFS_FEAT_ATTR_PTR(zoned),
> >  #endif
> > -- 
> > 2.41.0
diff mbox series

Patch

diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index e53614753391..f62bba0068ca 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -291,6 +291,7 @@  BTRFS_FEAT_ATTR_INCOMPAT(metadata_uuid, METADATA_UUID);
 BTRFS_FEAT_ATTR_COMPAT_RO(free_space_tree, FREE_SPACE_TREE);
 BTRFS_FEAT_ATTR_COMPAT_RO(block_group_tree, BLOCK_GROUP_TREE);
 BTRFS_FEAT_ATTR_INCOMPAT(raid1c34, RAID1C34);
+BTRFS_FEAT_ATTR_INCOMPAT(simple_quota, SIMPLE_QUOTA);
 #ifdef CONFIG_BLK_DEV_ZONED
 BTRFS_FEAT_ATTR_INCOMPAT(zoned, ZONED);
 #endif
@@ -322,6 +323,7 @@  static struct attribute *btrfs_supported_feature_attrs[] = {
 	BTRFS_FEAT_ATTR_PTR(free_space_tree),
 	BTRFS_FEAT_ATTR_PTR(raid1c34),
 	BTRFS_FEAT_ATTR_PTR(block_group_tree),
+	BTRFS_FEAT_ATTR_PTR(simple_quota),
 #ifdef CONFIG_BLK_DEV_ZONED
 	BTRFS_FEAT_ATTR_PTR(zoned),
 #endif