summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2024-07-13 12:03:44 +0300
committerDavid Sterba <dsterba@suse.com>2024-07-19 18:20:23 +0300
commitc3ece6b7ffb4a7c00e8d53cbf4026a32b6127914 (patch)
tree3efd8c387863d20ab8fa0ed177b19141affff292 /fs/btrfs/super.c
parent8e7860543a94784d744c7ce34b78a2e11beefa5c (diff)
downloadlinux-c3ece6b7ffb4a7c00e8d53cbf4026a32b6127914.tar.xz
btrfs: change BTRFS_MOUNT_* flags to 64bit type
Currently the BTRFS_MOUNT_* flags are already beyond 32 bits, this is going to cause compilation errors for some 32 bit systems, as their unsigned long is only 32 bits long, thus flag BTRFS_MOUNT_IGNORESUPERFLAGS overflows and can lead to errors. Fix the problem by: - Migrate all existing BTRFS_MOUNT_* flags to unsigned long long - Migrate all mount option related variables to unsigned long long * btrfs_fs_info::mount_opt * btrfs_fs_context::mount_opt * mount_opt parameter of btrfs_check_options() * old_opts parameter of btrfs_remount_begin() * old_opts parameter of btrfs_remount_cleanup() * mount_opt parameter of btrfs_check_mountopts_zoned() * mount_opt and opt parameters of check_ro_option() Fixes: 32e6216512b4 ("btrfs: introduce new "rescue=ignoresuperflags" mount option") Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 0eda8c21d861..08d33cb372fb 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -82,7 +82,7 @@ struct btrfs_fs_context {
u32 commit_interval;
u32 metadata_ratio;
u32 thread_pool_size;
- unsigned long mount_opt;
+ unsigned long long mount_opt;
unsigned long compress_type:4;
unsigned int compress_level;
refcount_t refs;
@@ -642,7 +642,7 @@ static void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info)
}
static bool check_ro_option(const struct btrfs_fs_info *fs_info,
- unsigned long mount_opt, unsigned long opt,
+ unsigned long long mount_opt, unsigned long long opt,
const char *opt_name)
{
if (mount_opt & opt) {
@@ -653,7 +653,8 @@ static bool check_ro_option(const struct btrfs_fs_info *fs_info,
return false;
}
-bool btrfs_check_options(const struct btrfs_fs_info *info, unsigned long *mount_opt,
+bool btrfs_check_options(const struct btrfs_fs_info *info,
+ unsigned long long *mount_opt,
unsigned long flags)
{
bool ret = true;
@@ -1231,7 +1232,7 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
}
static inline void btrfs_remount_begin(struct btrfs_fs_info *fs_info,
- unsigned long old_opts, int flags)
+ unsigned long long old_opts, int flags)
{
if (btrfs_raw_test_opt(old_opts, AUTO_DEFRAG) &&
(!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) ||
@@ -1245,7 +1246,7 @@ static inline void btrfs_remount_begin(struct btrfs_fs_info *fs_info,
}
static inline void btrfs_remount_cleanup(struct btrfs_fs_info *fs_info,
- unsigned long old_opts)
+ unsigned long long old_opts)
{
const bool cache_opt = btrfs_test_opt(fs_info, SPACE_CACHE);