btrfs: convert log messages to error level in btrfs_replay_log()
PATCH 1/1 btrfs: convert log messages to error level in btrfs_replay_log()
From: Filipe Manana <[email protected]>
We are logging messages as warnings but they should really have an error level instead, as if the respective conditions are met the mount will fail. So convert them to error level and also log the error code returned by read_tree_block().
Signed-off-by Filipe Manana <[email protected]>
--- fs/btrfs/disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
@@ -2004,7 +2004,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,int level =btrfs_super_log_root_level (disk_super);if (unlikely (fs_devices->rw_devices ==0 )) { -btrfs_warn (fs_info,"log replay required on RO media" ); +btrfs_err (fs_info,"log replay required on RO media" );return -EIO ; }
@@ -2018,9 +2018,9 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info, check.owner_root =BTRFS_TREE_LOG_OBJECTID ; log_tree_root->node =read_tree_block (fs_info, bytenr, &check);if (IS_ERR (log_tree_root->node)) { -btrfs_warn (fs_info,"failed to read log tree" ); ret =PTR_ERR (log_tree_root->node); log_tree_root->node =NULL ; +btrfs_err (fs_info,"failed to read log tree with error: %d" , ret);btrfs_put_root (log_tree_root);return ret; }
Signature · 1 line
2.47.2
Quoted 8 lines · On Tue, Feb 10, 2026 at 10:33:27AM +0000, [email protected] wrote:
From: Filipe Manana <[email protected]>
We are logging messages as warnings but they should really have an error level instead, as if the respective conditions are met the mount will fail. So convert them to error level and also log the error code returned by
read_tree_block().Signed-off-by Filipe Manana <[email protected]>
Reviewed-by David Sterba <[email protected]>