Linux-BTRFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH] btrfs-progs: fix stray error message in check
@ 2019-01-11 22:07 jeffm
  2019-01-15 17:39 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: jeffm @ 2019-01-11 22:07 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Jeff Mahoney

From: Jeff Mahoney <jeffm@suse.com>

Commit e578b59bf61 (btrfs-progs: convert strerror to implicit %m) missed
adding braces after a conditional so we will see the following message
whenever a tree block needs repair, regardless of whether repair was
successful: "Failed to repair btree: Success"

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 check/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/check/main.c b/check/main.c
index db18827b..44bfac4e 100644
--- a/check/main.c
+++ b/check/main.c
@@ -3362,9 +3362,10 @@ skip_walking:
 			printf("Try to repair the btree for root %llu\n",
 			       root->root_key.objectid);
 			ret = repair_btree(root, &corrupt_blocks);
-			if (ret < 0)
+			if (ret < 0) {
 				errno = -ret;
 				fprintf(stderr, "Failed to repair btree: %m\n");
+			}
 			if (!ret)
 				printf("Btree for root %llu is fixed\n",
 				       root->root_key.objectid);
-- 
2.16.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: fix stray error message in check
  2019-01-11 22:07 [PATCH] btrfs-progs: fix stray error message in check jeffm
@ 2019-01-15 17:39 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2019-01-15 17:39 UTC (permalink / raw)
  To: jeffm; +Cc: linux-btrfs

On Fri, Jan 11, 2019 at 05:07:49PM -0500, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> 
> Commit e578b59bf61 (btrfs-progs: convert strerror to implicit %m) missed
> adding braces after a conditional so we will see the following message
> whenever a tree block needs repair, regardless of whether repair was
> successful: "Failed to repair btree: Success"
> 
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 22:07 [PATCH] btrfs-progs: fix stray error message in check jeffm
2019-01-15 17:39 ` David Sterba

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox