diff options
author | Jeff Mahoney <jeffm@suse.com> | 2013-10-16 16:27:01 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 22:03:37 -0500 |
commit | cab45e22da48b523665b3566f43527a2fead1d1e (patch) | |
tree | e4c3dfbf5bad8298ef40cbb681461d7cac168990 /fs/btrfs | |
parent | 8b558c5f097b636209b654f4d7775ac96054d6e3 (diff) |
btrfs: add tracing for failed reservations
When debugging ENOSPC issues, it's nice to be able to see which
reservations failed as well as the ones which succeeded.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4062a65f9fb7..a807acc9a63e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3684,6 +3684,9 @@ commit_trans: | |||
3684 | goto again; | 3684 | goto again; |
3685 | } | 3685 | } |
3686 | 3686 | ||
3687 | trace_btrfs_space_reservation(root->fs_info, | ||
3688 | "space_info:enospc", | ||
3689 | data_sinfo->flags, bytes, 1); | ||
3687 | return -ENOSPC; | 3690 | return -ENOSPC; |
3688 | } | 3691 | } |
3689 | data_sinfo->bytes_may_use += bytes; | 3692 | data_sinfo->bytes_may_use += bytes; |
@@ -4335,6 +4338,10 @@ out: | |||
4335 | !block_rsv_use_bytes(global_rsv, orig_bytes)) | 4338 | !block_rsv_use_bytes(global_rsv, orig_bytes)) |
4336 | ret = 0; | 4339 | ret = 0; |
4337 | } | 4340 | } |
4341 | if (ret == -ENOSPC) | ||
4342 | trace_btrfs_space_reservation(root->fs_info, | ||
4343 | "space_info:enospc", | ||
4344 | space_info->flags, orig_bytes, 1); | ||
4338 | if (flushing) { | 4345 | if (flushing) { |
4339 | spin_lock(&space_info->lock); | 4346 | spin_lock(&space_info->lock); |
4340 | space_info->flush = 0; | 4347 | space_info->flush = 0; |