All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 4/4] btrfs-progs: check/original: Don't overwrite return value when we failed to repair
Date: Thu,  5 Jul 2018 15:37:31 +0800	[thread overview]
Message-ID: <20180705073731.18459-5-wqu@suse.com> (raw)
In-Reply-To: <20180705073731.18459-1-wqu@suse.com>

In check_inode_recs(), for repair mode we always reset @ret to 0.
It makes no sense and later we check@ret to determine if the repair is
successful.

Fix it by removing the offending overwrite.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check/main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/check/main.c b/check/main.c
index 2b5abb2d025b..08476968aaba 100644
--- a/check/main.c
+++ b/check/main.c
@@ -2764,7 +2764,6 @@ static int check_inode_recs(struct btrfs_root *root,
 				free_inode_rec(rec);
 				continue;
 			}
-			ret = 0;
 		}
 
 		if (!(repair && ret == 0))
-- 
2.18.0


  parent reply	other threads:[~2018-07-05  7:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05  7:37 [PATCH 0/4] Some random fuzz test fixes Qu Wenruo
2018-07-05  7:37 ` [PATCH 1/4] btrfs-progs: check: Remove the ability to rebuild root overwritting existing tree blocks Qu Wenruo
2018-07-05  8:50   ` Gu, Jinxiang
2018-07-05  9:41     ` Qu Wenruo
2018-07-06  1:53       ` Gu, Jinxiang
2018-08-02 19:36         ` David Sterba
2018-07-05  7:37 ` [PATCH 2/4] btrfs-progs: transaction: Error out other than panic when committing transaction Qu Wenruo
2018-07-05  9:33   ` Gu, Jinxiang
2018-07-05  7:37 ` [PATCH 3/4] btrfs-progs: check/original: Avoid infinite loop when failed to repair inode Qu Wenruo
2018-07-06  3:22   ` Gu, Jinxiang
2018-07-05  7:37 ` Qu Wenruo [this message]
2018-07-06  4:57   ` [PATCH 4/4] btrfs-progs: check/original: Don't overwrite return value when we failed to repair Gu, Jinxiang
2018-08-02 20:03 ` [PATCH 0/4] Some random fuzz test fixes David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180705073731.18459-5-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.