diff mbox series

[v5,18/18] fs: enable pre-content events on supported file systems

Message ID 33151057684a62a89b45466d53671c6232c34a68.1725481503.git.josef@toxicpanda.com (mailing list archive)
State Not Applicable, archived
Headers show
Series fanotify: add pre-content hooks | expand

Commit Message

Josef Bacik Sept. 4, 2024, 8:28 p.m. UTC
Now that all the code has been added for pre-content events, and the
various file systems that need the page fault hooks for fsnotify have
been updated, add FS_ALLOW_HSM to the currently tested file systems.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/bcachefs/fs.c   | 2 +-
 fs/btrfs/super.c   | 3 ++-
 fs/ext4/super.c    | 6 +++---
 fs/xfs/xfs_super.c | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

Comments

Amir Goldstein Sept. 5, 2024, 8:27 a.m. UTC | #1
On Wed, Sep 4, 2024 at 10:29 PM Josef Bacik <josef@toxicpanda.com> wrote:
>
> Now that all the code has been added for pre-content events, and the
> various file systems that need the page fault hooks for fsnotify have
> been updated, add FS_ALLOW_HSM to the currently tested file systems.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

I would not be devastated if this patch remains as is,
but I think it would be nicer to:
1. Move it before the fs specific patches
2. Set the HSM flag only on ext*
3. Add the HSM flag in other fs specific patches

Thanks,
Amir.

> ---
>  fs/bcachefs/fs.c   | 2 +-
>  fs/btrfs/super.c   | 3 ++-
>  fs/ext4/super.c    | 6 +++---
>  fs/xfs/xfs_super.c | 2 +-
>  4 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
> index 3a5f49affa0a..f889a105643b 100644
> --- a/fs/bcachefs/fs.c
> +++ b/fs/bcachefs/fs.c
> @@ -2124,7 +2124,7 @@ static struct file_system_type bcache_fs_type = {
>         .name                   = "bcachefs",
>         .init_fs_context        = bch2_init_fs_context,
>         .kill_sb                = bch2_kill_sb,
> -       .fs_flags               = FS_REQUIRES_DEV,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
>  };
>
>  MODULE_ALIAS_FS("bcachefs");
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 0eda8c21d861..201ed90a6083 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -2193,7 +2193,8 @@ static struct file_system_type btrfs_fs_type = {
>         .init_fs_context        = btrfs_init_fs_context,
>         .parameters             = btrfs_fs_parameters,
>         .kill_sb                = btrfs_kill_super,
> -       .fs_flags               = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_ALLOW_IDMAP,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
> +                                 FS_ALLOW_IDMAP | FS_ALLOW_HSM,
>   };
>
>  MODULE_ALIAS_FS("btrfs");
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index e72145c4ae5a..a042216fb370 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -137,7 +137,7 @@ static struct file_system_type ext2_fs_type = {
>         .init_fs_context        = ext4_init_fs_context,
>         .parameters             = ext4_param_specs,
>         .kill_sb                = ext4_kill_sb,
> -       .fs_flags               = FS_REQUIRES_DEV,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
>  };
>  MODULE_ALIAS_FS("ext2");
>  MODULE_ALIAS("ext2");
> @@ -153,7 +153,7 @@ static struct file_system_type ext3_fs_type = {
>         .init_fs_context        = ext4_init_fs_context,
>         .parameters             = ext4_param_specs,
>         .kill_sb                = ext4_kill_sb,
> -       .fs_flags               = FS_REQUIRES_DEV,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
>  };
>  MODULE_ALIAS_FS("ext3");
>  MODULE_ALIAS("ext3");
> @@ -7298,7 +7298,7 @@ static struct file_system_type ext4_fs_type = {
>         .init_fs_context        = ext4_init_fs_context,
>         .parameters             = ext4_param_specs,
>         .kill_sb                = ext4_kill_sb,
> -       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
>  };
>  MODULE_ALIAS_FS("ext4");
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 27e9f749c4c7..04a6ec7bc2ae 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -2052,7 +2052,7 @@ static struct file_system_type xfs_fs_type = {
>         .init_fs_context        = xfs_init_fs_context,
>         .parameters             = xfs_fs_parameters,
>         .kill_sb                = xfs_kill_sb,
> -       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
> +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
>  };
>  MODULE_ALIAS_FS("xfs");
>
> --
> 2.43.0
>
Jan Kara Sept. 5, 2024, 10:36 a.m. UTC | #2
On Thu 05-09-24 10:27:52, Amir Goldstein wrote:
> On Wed, Sep 4, 2024 at 10:29 PM Josef Bacik <josef@toxicpanda.com> wrote:
> >
> > Now that all the code has been added for pre-content events, and the
> > various file systems that need the page fault hooks for fsnotify have
> > been updated, add FS_ALLOW_HSM to the currently tested file systems.
> >
> > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> 
> I would not be devastated if this patch remains as is,
> but I think it would be nicer to:
> 1. Move it before the fs specific patches
> 2. Set the HSM flag only on ext*
> 3. Add the HSM flag in other fs specific patches

I agree that doing this inside the patch where we tweak its functions to
properly support HSM would be more natural. And then only ext4 will remain
here. I guess I'll do this on commit.

								Honza

> 
> Thanks,
> Amir.
> 
> > ---
> >  fs/bcachefs/fs.c   | 2 +-
> >  fs/btrfs/super.c   | 3 ++-
> >  fs/ext4/super.c    | 6 +++---
> >  fs/xfs/xfs_super.c | 2 +-
> >  4 files changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
> > index 3a5f49affa0a..f889a105643b 100644
> > --- a/fs/bcachefs/fs.c
> > +++ b/fs/bcachefs/fs.c
> > @@ -2124,7 +2124,7 @@ static struct file_system_type bcache_fs_type = {
> >         .name                   = "bcachefs",
> >         .init_fs_context        = bch2_init_fs_context,
> >         .kill_sb                = bch2_kill_sb,
> > -       .fs_flags               = FS_REQUIRES_DEV,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
> >  };
> >
> >  MODULE_ALIAS_FS("bcachefs");
> > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > index 0eda8c21d861..201ed90a6083 100644
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -2193,7 +2193,8 @@ static struct file_system_type btrfs_fs_type = {
> >         .init_fs_context        = btrfs_init_fs_context,
> >         .parameters             = btrfs_fs_parameters,
> >         .kill_sb                = btrfs_kill_super,
> > -       .fs_flags               = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_ALLOW_IDMAP,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
> > +                                 FS_ALLOW_IDMAP | FS_ALLOW_HSM,
> >   };
> >
> >  MODULE_ALIAS_FS("btrfs");
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index e72145c4ae5a..a042216fb370 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -137,7 +137,7 @@ static struct file_system_type ext2_fs_type = {
> >         .init_fs_context        = ext4_init_fs_context,
> >         .parameters             = ext4_param_specs,
> >         .kill_sb                = ext4_kill_sb,
> > -       .fs_flags               = FS_REQUIRES_DEV,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
> >  };
> >  MODULE_ALIAS_FS("ext2");
> >  MODULE_ALIAS("ext2");
> > @@ -153,7 +153,7 @@ static struct file_system_type ext3_fs_type = {
> >         .init_fs_context        = ext4_init_fs_context,
> >         .parameters             = ext4_param_specs,
> >         .kill_sb                = ext4_kill_sb,
> > -       .fs_flags               = FS_REQUIRES_DEV,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_HSM,
> >  };
> >  MODULE_ALIAS_FS("ext3");
> >  MODULE_ALIAS("ext3");
> > @@ -7298,7 +7298,7 @@ static struct file_system_type ext4_fs_type = {
> >         .init_fs_context        = ext4_init_fs_context,
> >         .parameters             = ext4_param_specs,
> >         .kill_sb                = ext4_kill_sb,
> > -       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
> >  };
> >  MODULE_ALIAS_FS("ext4");
> >
> > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> > index 27e9f749c4c7..04a6ec7bc2ae 100644
> > --- a/fs/xfs/xfs_super.c
> > +++ b/fs/xfs/xfs_super.c
> > @@ -2052,7 +2052,7 @@ static struct file_system_type xfs_fs_type = {
> >         .init_fs_context        = xfs_init_fs_context,
> >         .parameters             = xfs_fs_parameters,
> >         .kill_sb                = xfs_kill_sb,
> > -       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
> > +       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
> >  };
> >  MODULE_ALIAS_FS("xfs");
> >
> > --
> > 2.43.0
> >
diff mbox series

Patch

diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 3a5f49affa0a..f889a105643b 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -2124,7 +2124,7 @@  static struct file_system_type bcache_fs_type = {
 	.name			= "bcachefs",
 	.init_fs_context	= bch2_init_fs_context,
 	.kill_sb		= bch2_kill_sb,
-	.fs_flags		= FS_REQUIRES_DEV,
+	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_HSM,
 };
 
 MODULE_ALIAS_FS("bcachefs");
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 0eda8c21d861..201ed90a6083 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2193,7 +2193,8 @@  static struct file_system_type btrfs_fs_type = {
 	.init_fs_context	= btrfs_init_fs_context,
 	.parameters		= btrfs_fs_parameters,
 	.kill_sb		= btrfs_kill_super,
-	.fs_flags		= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_ALLOW_IDMAP,
+	.fs_flags		= FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA |
+				  FS_ALLOW_IDMAP | FS_ALLOW_HSM,
  };
 
 MODULE_ALIAS_FS("btrfs");
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e72145c4ae5a..a042216fb370 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -137,7 +137,7 @@  static struct file_system_type ext2_fs_type = {
 	.init_fs_context	= ext4_init_fs_context,
 	.parameters		= ext4_param_specs,
 	.kill_sb		= ext4_kill_sb,
-	.fs_flags		= FS_REQUIRES_DEV,
+	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_HSM,
 };
 MODULE_ALIAS_FS("ext2");
 MODULE_ALIAS("ext2");
@@ -153,7 +153,7 @@  static struct file_system_type ext3_fs_type = {
 	.init_fs_context	= ext4_init_fs_context,
 	.parameters		= ext4_param_specs,
 	.kill_sb		= ext4_kill_sb,
-	.fs_flags		= FS_REQUIRES_DEV,
+	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_HSM,
 };
 MODULE_ALIAS_FS("ext3");
 MODULE_ALIAS("ext3");
@@ -7298,7 +7298,7 @@  static struct file_system_type ext4_fs_type = {
 	.init_fs_context	= ext4_init_fs_context,
 	.parameters		= ext4_param_specs,
 	.kill_sb		= ext4_kill_sb,
-	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
+	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
 };
 MODULE_ALIAS_FS("ext4");
 
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 27e9f749c4c7..04a6ec7bc2ae 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -2052,7 +2052,7 @@  static struct file_system_type xfs_fs_type = {
 	.init_fs_context	= xfs_init_fs_context,
 	.parameters		= xfs_fs_parameters,
 	.kill_sb		= xfs_kill_sb,
-	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
+	.fs_flags		= FS_REQUIRES_DEV | FS_ALLOW_IDMAP | FS_ALLOW_HSM,
 };
 MODULE_ALIAS_FS("xfs");