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

Amir Goldstein
2024-09-05T08:28:04Z

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
>