diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-12-15 11:05:37 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 15:09:35 +0200 |
commit | 9a3daff320260723b9e64b5b3b9c6592a0cd006a (patch) | |
tree | 62f49eaa7887126348d424010dff68aa0e48cfa4 /fs/btrfs/extent-tree.c | |
parent | btrfs: Document consistency of transaction->io_bgs list (diff) | |
download | linux-9a3daff320260723b9e64b5b3b9c6592a0cd006a.tar.xz linux-9a3daff320260723b9e64b5b3b9c6592a0cd006a.zip |
btrfs: Add enospc_debug printing in metadata_reserve_bytes
Currently when enospc_debug mount option is turned on we do not print
any debug info in case metadata reservation failures happen. Fix this
by adding the necessary hook in reserve_metadata_bytes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 9a677860f64d..85258e85a030 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5394,10 +5394,15 @@ static int reserve_metadata_bytes(struct btrfs_root *root, !block_rsv_use_bytes(global_rsv, orig_bytes)) ret = 0; } - if (ret == -ENOSPC) + if (ret == -ENOSPC) { trace_btrfs_space_reservation(fs_info, "space_info:enospc", block_rsv->space_info->flags, orig_bytes, 1); + + if (btrfs_test_opt(fs_info, ENOSPC_DEBUG)) + dump_space_info(fs_info, block_rsv->space_info, + orig_bytes, 0); + } return ret; } |