提交 1409e6cc 编写于 作者: J Josef Bacik 提交者: David Sterba

btrfs: handle record_root_in_trans failure in btrfs_record_root_in_trans

record_root_in_trans can fail currently, handle this failure properly.
Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 1c442d22
...@@ -492,6 +492,7 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans, ...@@ -492,6 +492,7 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
struct btrfs_root *root) struct btrfs_root *root)
{ {
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
int ret;
if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state)) if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
return 0; return 0;
...@@ -506,10 +507,10 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans, ...@@ -506,10 +507,10 @@ int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
return 0; return 0;
mutex_lock(&fs_info->reloc_mutex); mutex_lock(&fs_info->reloc_mutex);
record_root_in_trans(trans, root, 0); ret = record_root_in_trans(trans, root, 0);
mutex_unlock(&fs_info->reloc_mutex); mutex_unlock(&fs_info->reloc_mutex);
return 0; return ret;
} }
static inline int is_transaction_blocked(struct btrfs_transaction *trans) static inline int is_transaction_blocked(struct btrfs_transaction *trans)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册