Skip to content

Commit 68f1b4b

Browse files
committed
btrfs: qgroup: warn about inconsistent qgroups when relation update fails
Calling btrfs_handle_fs_error() after btrfs_run_qgroups() fails to update the qgroup status is probably not necessary, this would turn the filesystem to read-only. For the same reason aborting the transaction is also not a good option. The state is left inconsistent and can be fixed by rescan, printing a warning should be sufficient. Return code reflects the status of adding/deleting the relation and if the transaction was ended properly. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent fa79ac1 commit 68f1b4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/btrfs/ioctl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3880,8 +3880,9 @@ static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg)
38803880
err = btrfs_run_qgroups(trans);
38813881
mutex_unlock(&fs_info->qgroup_ioctl_lock);
38823882
if (err < 0)
3883-
btrfs_handle_fs_error(fs_info, err,
3884-
"failed to update qgroup status and info");
3883+
btrfs_warn(fs_info,
3884+
"qgroup status update failed after %s relation, marked as inconsistent",
3885+
sa->assign ? "adding" : "deleting");
38853886
err = btrfs_end_transaction(trans);
38863887
if (err && !ret)
38873888
ret = err;

0 commit comments

Comments
 (0)