Skip to contentSkip to conversation

Btrfs: include error on messages about failure to write space/inode caches

PATCH In review [email protected] 2 participants 3 messages May 18, 2020 – May 19, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Btrfs: include error on messages about failure to write space/inode caches

From: Filipe Manana <[email protected]>

Currently the error messages logged when we fail to write a free space cache or an inode cache are not very useful as they don't mention what was the error. So include the error number in the messages.

---
 fs/btrfs/free-space-cache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
fs/btrfs/free-space-cache.c +6 -6
index 3c353a337b91..3f63deb9f188 100644
@@ -1193,8 +1193,8 @@ static int __btrfs_wait_cache_io(struct btrfs_root *root,
 		if (block_group) {
 #ifdef CONFIG_BTRFS_DEBUG
 			btrfs_err(root->fs_info,
-				  "failed to write free space cache for block group %llu",
-				  block_group->start);
+	  "failed to write free space cache for block group %llu error %d",
+				  block_group->start, ret);
 #endif
 		}
 	}
@@ -1417,8 +1417,8 @@ int btrfs_write_out_cache(struct btrfs_trans_handle *trans,
 	if (ret) {
 #ifdef CONFIG_BTRFS_DEBUG
 		btrfs_err(fs_info,
-			  "failed to write free space cache for block group %llu",
-			  block_group->start);
+	  "failed to write free space cache for block group %llu error %d",
+			  block_group->start, ret);
 #endif
 		spin_lock(&block_group->lock);
 		block_group->disk_cache_state = BTRFS_DC_ERROR;
@@ -3997,8 +3997,8 @@ int btrfs_write_out_ino_cache(struct btrfs_root *root,
 					inode->i_size, true);
 #ifdef CONFIG_BTRFS_DEBUG
 		btrfs_err(fs_info,
-			  "failed to write free ino cache for root %llu",
-			  root->root_key.objectid);
+			  "failed to write free ino cache for root %llu error %d",
+			  root->root_key.objectid, ret);
 #endif
 	}
 
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · On Mon, May 18, 2020 at 05:34:11PM +0100, [email protected] wrote:

From: Filipe Manana <[email protected]>

Currently the error messages logged when we fail to write a free space cache or an inode cache are not very useful as they don't mention what was the error. So include the error number in the messages.

1 and 2 added to misc-next, thanks.

As the 2nd patch fixes a problem introduced in this dev cycle it's ok push it as a regression fix. But as we're at rc6 I'd prefer to postpone it for the merge window time, unless it's really annoying and hinders testing.

#2 lore raw
Quoted 8 lines · David Sterba
Quoted 6 lines · On Mon, May 18, 2020 at 05:34:11PM +0100, [email protected] wrote:

From: Filipe Manana <[email protected]>

Currently the error messages logged when we fail to write a free space cache or an inode cache are not very useful as they don't mention what was the error. So include the error number in the messages.

Quoted 8 lines
Quoted 1 line

1 and 2 added to misc-next, thanks.

As the 2nd patch fixes a problem introduced in this dev cycle it's ok push it as a regression fix. But as we're at rc6 I'd prefer to postpone it for the merge window time, unless it's really annoying and hinders testing.

Agreed. I consider it a very minor thing.

Thanks.