提交 1c442d22 编写于 作者: J Josef Bacik 提交者: David Sterba

btrfs: handle record_root_in_trans failure in qgroup_account_snapshot

record_root_in_trans can fail currently, so handle this failure
properly.
Reviewed-by: NQu Wenruo <wqu@suse.com>
Signed-off-by: NJosef Bacik <josef@toxicpanda.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 68075ea8
...@@ -1454,7 +1454,9 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, ...@@ -1454,7 +1454,9 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
* recorded root will never be updated again, causing an outdated root * recorded root will never be updated again, causing an outdated root
* item. * item.
*/ */
record_root_in_trans(trans, src, 1); ret = record_root_in_trans(trans, src, 1);
if (ret)
return ret;
/* /*
* btrfs_qgroup_inherit relies on a consistent view of the usage for the * btrfs_qgroup_inherit relies on a consistent view of the usage for the
...@@ -1523,7 +1525,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans, ...@@ -1523,7 +1525,7 @@ static int qgroup_account_snapshot(struct btrfs_trans_handle *trans,
* insert_dir_item() * insert_dir_item()
*/ */
if (!ret) if (!ret)
record_root_in_trans(trans, parent, 1); ret = record_root_in_trans(trans, parent, 1);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册