提交 cab45e22 编写于 作者: J Jeff Mahoney 提交者: Chris Mason

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: NJeff Mahoney <jeffm@suse.com>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 8b558c5f
...@@ -3684,6 +3684,9 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes) ...@@ -3684,6 +3684,9 @@ int btrfs_check_data_free_space(struct inode *inode, u64 bytes)
goto again; goto again;
} }
trace_btrfs_space_reservation(root->fs_info,
"space_info:enospc",
data_sinfo->flags, bytes, 1);
return -ENOSPC; return -ENOSPC;
} }
data_sinfo->bytes_may_use += bytes; data_sinfo->bytes_may_use += bytes;
...@@ -4335,6 +4338,10 @@ static int reserve_metadata_bytes(struct btrfs_root *root, ...@@ -4335,6 +4338,10 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
!block_rsv_use_bytes(global_rsv, orig_bytes)) !block_rsv_use_bytes(global_rsv, orig_bytes))
ret = 0; ret = 0;
} }
if (ret == -ENOSPC)
trace_btrfs_space_reservation(root->fs_info,
"space_info:enospc",
space_info->flags, orig_bytes, 1);
if (flushing) { if (flushing) {
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
space_info->flush = 0; space_info->flush = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册