[1/2] Btrfs: include error on messages about failure to write space/inode caches
diff mbox series

Message ID 20200518163411.18660-1-fdmanana@kernel.org
State New
Headers show
Series
  • [1/2] Btrfs: include error on messages about failure to write space/inode caches
Related show

Commit Message

Filipe Manana May 18, 2020, 4:34 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

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.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/free-space-cache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

David Sterba May 19, 2020, 1:06 p.m. UTC | #1
On Mon, May 18, 2020 at 05:34:11PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

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.
Filipe Manana May 19, 2020, 1:18 p.m. UTC | #2
On Tue, May 19, 2020 at 2:07 PM David Sterba <dsterba@suse.cz> wrote:
>
> On Mon, May 18, 2020 at 05:34:11PM +0100, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > 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.
> >
> > Signed-off-by: Filipe Manana <fdmanana@suse.com>
>
> 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.

Patch
diff mbox series

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 3c353a337b91..3f63deb9f188 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -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
 	}