From patchwork Thu Jul 5 07:37:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10508305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1EC1360325 for ; Thu, 5 Jul 2018 07:37:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF9E28E70 for ; Thu, 5 Jul 2018 07:37:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0235E28E74; Thu, 5 Jul 2018 07:37:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F24FE28E70 for ; Thu, 5 Jul 2018 07:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353AbeGEHhm (ORCPT ); Thu, 5 Jul 2018 03:37:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:53550 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753335AbeGEHhl (ORCPT ); Thu, 5 Jul 2018 03:37:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8EB11AD6C for ; Thu, 5 Jul 2018 07:37:39 +0000 (UTC) From: Qu Wenruo 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 Message-Id: <20180705073731.18459-5-wqu@suse.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180705073731.18459-1-wqu@suse.com> References: <20180705073731.18459-1-wqu@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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))