Skip to content

Commit

Permalink
btrfs-progs: qgroup: don't return 1 if qgroup is marked inconsistent …
Browse files Browse the repository at this point in the history
…during relationship assignment

BTRFS_IOC_QGROUP_ASSIGN ioctl could return >0 if qgroup is marked
inconsistent after successful relationship assignment/removal.

We leak the return value as the final return value of btrfs command.
But according to the man page, return value other than 0 means failure.

Fix this by resetting the return value to 0 for --no-rescan case.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
adam900710 authored and kdave committed Oct 23, 2018
1 parent 5d24e63 commit 51e1fae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmds-qgroup.c
Expand Up @@ -123,6 +123,7 @@ static int _cmd_qgroup_assign(int assign, int argc, char **argv,
error("quota rescan failed: %m");
} else {
warning("quotas may be inconsistent, rescan needed");
ret = 0;
}
}
close_file_or_dir(fd, dirstream);
Expand Down

0 comments on commit 51e1fae

Please sign in to comment.