* [PATCH v2 1/2] btrfs: restore mount option info messages during mount
2025-08-12 18:00 [PATCH v2 0/2] Fix and unify mount option log messages sawara04.o
@ 2025-08-12 18:00 ` sawara04.o
2025-08-12 18:00 ` [PATCH v2 2/2] btrfs: Align log messages and fix duplicates for NODATACOW/NODATASUM sawara04.o
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: sawara04.o @ 2025-08-12 18:00 UTC (permalink / raw)
To: clm, josef, dsterba, johannes.thumshirn, brauner
Cc: Kyoji Ogasawara, linux-btrfs
From: Kyoji Ogasawara <sawara04.o@gmail.com>
After the fsconfig migration, mount option info messages are no longer
displayed during mount operations because btrfs_emit_options() is only
called during remount, not during initial mount.
Fix this by calling btrfs_emit_options() in btrfs_fill_super() after
open_ctree() succeeds. Additionally, prevent log duplication by ensuring
btrfs_check_options() handles validation with warn-level and err-level
messages, while btrfs_emit_options() provides info-level messages.
Fixes: eddb1a433f26 ("btrfs: add reconfigure callback for fs_context")
Signed-off-by: Kyoji Ogasawara <sawara04.o@gmail.com>
---
fs/btrfs/super.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index a0c65adce1ab..2677754ec8f7 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -88,6 +88,9 @@ struct btrfs_fs_context {
refcount_t refs;
};
+static void btrfs_emit_options(struct btrfs_fs_info *info,
+ struct btrfs_fs_context *old);
+
enum {
Opt_acl,
Opt_clear_cache,
@@ -689,12 +692,9 @@ bool btrfs_check_options(const struct btrfs_fs_info *info,
if (!test_bit(BTRFS_FS_STATE_REMOUNTING, &info->fs_state)) {
if (btrfs_raw_test_opt(*mount_opt, SPACE_CACHE)) {
- btrfs_info(info, "disk space caching is enabled");
btrfs_warn(info,
"space cache v1 is being deprecated and will be removed in a future release, please use -o space_cache=v2");
}
- if (btrfs_raw_test_opt(*mount_opt, FREE_SPACE_TREE))
- btrfs_info(info, "using free-space-tree");
}
return ret;
@@ -971,6 +971,8 @@ static int btrfs_fill_super(struct super_block *sb,
return err;
}
+ btrfs_emit_options(fs_info, NULL);
+
inode = btrfs_iget(BTRFS_FIRST_FREE_OBJECTID, fs_info->fs_root);
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
--
2.50.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 2/2] btrfs: Align log messages and fix duplicates for NODATACOW/NODATASUM
2025-08-12 18:00 [PATCH v2 0/2] Fix and unify mount option log messages sawara04.o
2025-08-12 18:00 ` [PATCH v2 1/2] btrfs: restore mount option info messages during mount sawara04.o
@ 2025-08-12 18:00 ` sawara04.o
2025-08-13 1:02 ` [PATCH v2 0/2] Fix and unify mount option log messages Qu Wenruo
2025-08-13 10:10 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: sawara04.o @ 2025-08-12 18:00 UTC (permalink / raw)
To: clm, josef, dsterba, johannes.thumshirn, brauner
Cc: Kyoji Ogasawara, linux-btrfs
From: Kyoji Ogasawara <sawara04.o@gmail.com>
Fix duplicate log messages and make them the same as the log output
messages related to NODATACOW and NODATASUM, which are output with the
same logic.
Fixes: eddb1a433f26 ("btrfs: add reconfigure callback for fs_context")
Signed-off-by: Kyoji Ogasawara <sawara04.o@gmail.com>
---
fs/btrfs/super.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 2677754ec8f7..76c2618b427c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1430,7 +1430,7 @@ static void btrfs_emit_options(struct btrfs_fs_info *info,
{
btrfs_info_if_set(info, old, NODATASUM, "setting nodatasum");
btrfs_info_if_set(info, old, DEGRADED, "allowing degraded mounts");
- btrfs_info_if_set(info, old, NODATASUM, "setting nodatasum");
+ btrfs_info_if_set(info, old, NODATACOW, "setting nodatacow");
btrfs_info_if_set(info, old, SSD, "enabling ssd optimizations");
btrfs_info_if_set(info, old, SSD_SPREAD, "using spread ssd allocation scheme");
btrfs_info_if_set(info, old, NOBARRIER, "turning off barriers");
@@ -1452,6 +1452,7 @@ static void btrfs_emit_options(struct btrfs_fs_info *info,
btrfs_info_if_set(info, old, IGNOREMETACSUMS, "ignoring meta csums");
btrfs_info_if_set(info, old, IGNORESUPERFLAGS, "ignoring unknown super block flags");
+ btrfs_info_if_unset(info, old, NODATASUM, "setting datasum");
btrfs_info_if_unset(info, old, NODATACOW, "setting datacow");
btrfs_info_if_unset(info, old, SSD, "not using ssd optimizations");
btrfs_info_if_unset(info, old, SSD_SPREAD, "not using spread ssd allocation scheme");
--
2.50.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2 0/2] Fix and unify mount option log messages
2025-08-12 18:00 [PATCH v2 0/2] Fix and unify mount option log messages sawara04.o
2025-08-12 18:00 ` [PATCH v2 1/2] btrfs: restore mount option info messages during mount sawara04.o
2025-08-12 18:00 ` [PATCH v2 2/2] btrfs: Align log messages and fix duplicates for NODATACOW/NODATASUM sawara04.o
@ 2025-08-13 1:02 ` Qu Wenruo
2025-08-13 10:10 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2025-08-13 1:02 UTC (permalink / raw)
To: sawara04.o, clm, josef, dsterba, johannes.thumshirn, brauner; +Cc: linux-btrfs
在 2025/8/13 03:30, sawara04.o@gmail.com 写道:
> From: Kyoji Ogasawara <sawara04.o@gmail.com>
>
> This patch series fixes and unifies the log messages related to btrfs
> mount options.
>
> The first patch addresses a regression where mount option messages were
> no longer displayed during initial mounts after the fsconfig migration.
>
> The second patch unifies the log messages for NODATACOW and NODATASUM
> options, which were being handled with the same logic but had
> inconsistent and duplicate messages.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
>
> Thanks,
> Kyoji
>
> Kyoji Ogasawara (2):
> btrfs: restore mount option info messages during mount
> btrfs: Align log messages and fix duplicates for NODATACOW/NODATASUM
>
> fs/btrfs/super.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] Fix and unify mount option log messages
2025-08-12 18:00 [PATCH v2 0/2] Fix and unify mount option log messages sawara04.o
` (2 preceding siblings ...)
2025-08-13 1:02 ` [PATCH v2 0/2] Fix and unify mount option log messages Qu Wenruo
@ 2025-08-13 10:10 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2025-08-13 10:10 UTC (permalink / raw)
To: sawara04.o; +Cc: clm, josef, dsterba, johannes.thumshirn, brauner, linux-btrfs
On Wed, Aug 13, 2025 at 03:00:05AM +0900, sawara04.o@gmail.com wrote:
> From: Kyoji Ogasawara <sawara04.o@gmail.com>
>
> This patch series fixes and unifies the log messages related to btrfs
> mount options.
>
> The first patch addresses a regression where mount option messages were
> no longer displayed during initial mounts after the fsconfig migration.
>
> The second patch unifies the log messages for NODATACOW and NODATASUM
> options, which were being handled with the same logic but had
> inconsistent and duplicate messages.
>
> Thanks,
> Kyoji
>
> Kyoji Ogasawara (2):
> btrfs: restore mount option info messages during mount
> btrfs: Align log messages and fix duplicates for NODATACOW/NODATASUM
Added to for-next, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread