diff mbox series

[v2,1/2] btrfs: print the block rsv type when we fail our reservation

Message ID d3568eaa428026c8e144f253a341e77cd7b7dec6.1603745723.git.josef@toxicpanda.com
State New, archived
Headers show
Series Some block rsv fixes | expand

Commit Message

Josef Bacik Oct. 26, 2020, 8:57 p.m. UTC
To help with debugging, print the type of the block rsv when we fail to
use our target block rsv in btrfs_use_block_rsv.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/block-rsv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nikolay Borisov Oct. 27, 2020, 8:55 a.m. UTC | #1
On 26.10.20 г. 22:57 ч., Josef Bacik wrote:
> To help with debugging, print the type of the block rsv when we fail to
> use our target block rsv in btrfs_use_block_rsv.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Yeah, this now produces:

 [  544.672035] BTRFS: block rsv 1 returned -28

which is still cryptic without consulting the enum in block-rsv.h but I
guess it's better than nothing.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>


> ---
>  fs/btrfs/block-rsv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
> index 4651f8bf890b..04a6226e0388 100644
> --- a/fs/btrfs/block-rsv.c
> +++ b/fs/btrfs/block-rsv.c
> @@ -519,7 +519,8 @@ struct btrfs_block_rsv *btrfs_use_block_rsv(struct btrfs_trans_handle *trans,
>  				/*DEFAULT_RATELIMIT_BURST*/ 1);
>  		if (__ratelimit(&_rs))
>  			WARN(1, KERN_DEBUG
> -				"BTRFS: block rsv returned %d\n", ret);
> +				"BTRFS: block rsv %d returned %d\n",
> +				block_rsv->type, ret);
>  	}
>  try_reserve:
>  	ret = btrfs_reserve_metadata_bytes(root, block_rsv, blocksize,
>
diff mbox series

Patch

diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
index 4651f8bf890b..04a6226e0388 100644
--- a/fs/btrfs/block-rsv.c
+++ b/fs/btrfs/block-rsv.c
@@ -519,7 +519,8 @@  struct btrfs_block_rsv *btrfs_use_block_rsv(struct btrfs_trans_handle *trans,
 				/*DEFAULT_RATELIMIT_BURST*/ 1);
 		if (__ratelimit(&_rs))
 			WARN(1, KERN_DEBUG
-				"BTRFS: block rsv returned %d\n", ret);
+				"BTRFS: block rsv %d returned %d\n",
+				block_rsv->type, ret);
 	}
 try_reserve:
 	ret = btrfs_reserve_metadata_bytes(root, block_rsv, blocksize,