提交 36b96fdc 编写于 作者: S Sargun Dhillon 提交者: David Sterba

btrfs: Report error on removing qgroup if del_qgroup_item fails

Previously, we were calling del_qgroup_item, and ignoring the return code
resulting in a potential to have divergent in-memory state without an
error. Perhaps, it makes sense to handle this error code, and put the
filesystem into a read only, or similar state.

This patch only adds reporting of the error if the error is fatal,
(any error other than qgroup not found).
Signed-off-by: NSargun Dhillon <sargun@sargun.me>
Reviewed-by: NQu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 e6311f24
...@@ -1305,6 +1305,8 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, ...@@ -1305,6 +1305,8 @@ int btrfs_remove_qgroup(struct btrfs_trans_handle *trans,
} }
} }
ret = del_qgroup_item(trans, quota_root, qgroupid); ret = del_qgroup_item(trans, quota_root, qgroupid);
if (ret && ret != -ENOENT)
goto out;
while (!list_empty(&qgroup->groups)) { while (!list_empty(&qgroup->groups)) {
list = list_first_entry(&qgroup->groups, list = list_first_entry(&qgroup->groups,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册