diff mbox series

btrfs-progs: qgroup-verify: Remove duplicated message in report_qgroups

Message ID 20200315034253.11261-1-marcos@mpdesouza.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: qgroup-verify: Remove duplicated message in report_qgroups | expand

Commit Message

Marcos Paulo de Souza March 15, 2020, 3:42 a.m. UTC
From: Marcos Paulo de Souza <mpdesouza@suse.com>

Since 1d5b2ad9 ("btrfs-progs: qgroup-verify: Don't treat qgroup
difference as error if the fs hasn't initialized a rescan") a new
message is being printed when the qgroups is incosistent and the rescan
hasn't being executed, so remove the later message send to stderr.

While in this function, simplify the check for a not executed rescan
since !counts.rescan_running and counts.rescan_running == 0 means the
same thing.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 check/qgroup-verify.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Qu Wenruo March 16, 2020, 12:04 p.m. UTC | #1
On 2020/3/15 上午11:42, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> Since 1d5b2ad9 ("btrfs-progs: qgroup-verify: Don't treat qgroup
> difference as error if the fs hasn't initialized a rescan") a new
> message is being printed when the qgroups is incosistent and the rescan
> hasn't being executed, so remove the later message send to stderr.
> 
> While in this function, simplify the check for a not executed rescan
> since !counts.rescan_running and counts.rescan_running == 0 means the
> same thing.
> 
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>  check/qgroup-verify.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c
> index afe15acf..685370d6 100644
> --- a/check/qgroup-verify.c
> +++ b/check/qgroup-verify.c
> @@ -1336,14 +1336,11 @@ int report_qgroups(int all)
>  	/*
>  	 * It's possible that rescan hasn't been initialized yet.
>  	 */
> -	if (counts.qgroup_inconsist && !counts.rescan_running &&
> -	    counts.rescan_running == 0) {
> +	if (counts.qgroup_inconsist && !counts.rescan_running) {
>  		printf(
>  "Rescan hasn't been initialized, a difference in qgroup accounting is expected\n");
>  		skip_err = true;
>  	}
> -	if (counts.qgroup_inconsist && !counts.rescan_running)
> -		fprintf(stderr, "Qgroup are marked as inconsistent.\n");
>  	node = rb_first(&counts.root);
>  	while (node) {
>  		c = rb_entry(node, struct qgroup_count, rb_node);
>
David Sterba March 23, 2020, 7:39 p.m. UTC | #2
On Sun, Mar 15, 2020 at 12:42:53AM -0300, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> Since 1d5b2ad9 ("btrfs-progs: qgroup-verify: Don't treat qgroup
> difference as error if the fs hasn't initialized a rescan") a new
> message is being printed when the qgroups is incosistent and the rescan
> hasn't being executed, so remove the later message send to stderr.
> 
> While in this function, simplify the check for a not executed rescan
> since !counts.rescan_running and counts.rescan_running == 0 means the
> same thing.
> 
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c
index afe15acf..685370d6 100644
--- a/check/qgroup-verify.c
+++ b/check/qgroup-verify.c
@@ -1336,14 +1336,11 @@  int report_qgroups(int all)
 	/*
 	 * It's possible that rescan hasn't been initialized yet.
 	 */
-	if (counts.qgroup_inconsist && !counts.rescan_running &&
-	    counts.rescan_running == 0) {
+	if (counts.qgroup_inconsist && !counts.rescan_running) {
 		printf(
 "Rescan hasn't been initialized, a difference in qgroup accounting is expected\n");
 		skip_err = true;
 	}
-	if (counts.qgroup_inconsist && !counts.rescan_running)
-		fprintf(stderr, "Qgroup are marked as inconsistent.\n");
 	node = rb_first(&counts.root);
 	while (node) {
 		c = rb_entry(node, struct qgroup_count, rb_node);