From patchwork Thu Jan 31 02:30:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10789563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B742C922 for ; Thu, 31 Jan 2019 02:50:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA7BA3063C for ; Thu, 31 Jan 2019 02:50:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E07430646; Thu, 31 Jan 2019 02:50:44 +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 560593063C for ; Thu, 31 Jan 2019 02:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbfAaCun (ORCPT ); Wed, 30 Jan 2019 21:50:43 -0500 Received: from gateway24.websitewelcome.com ([192.185.51.122]:13857 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfAaCum (ORCPT ); Wed, 30 Jan 2019 21:50:42 -0500 X-Greylist: delayed 1223 seconds by postgrey-1.27 at vger.kernel.org; Wed, 30 Jan 2019 21:50:42 EST Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 6583EC9AB for ; Wed, 30 Jan 2019 20:30:18 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id p27OgKqEp4FKpp27Ogi0kB; Wed, 30 Jan 2019 20:30:18 -0600 X-Authority-Reason: nr=8 Received: from [189.250.82.227] (port=40668 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1gp27N-002kdJ-MS; Wed, 30 Jan 2019 20:30:17 -0600 Date: Wed, 30 Jan 2019 20:30:16 -0600 From: "Gustavo A. R. Silva" To: Chris Mason , Josef Bacik , David Sterba , Qu Wenruo Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] btrfs: qgroup: Fix inconsistent IS_ERR and PTR_ERR Message-ID: <20190131023016.GA3413@embeddedor> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.250.82.227 X-Source-L: No X-Exim-ID: 1gp27N-002kdJ-MS X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.82.227]:40668 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes 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 Fix inconsistent IS_ERR and PTR_ERR in btrfs_qgroup_trace_subtree_after_cow The proper pointer to be passed as argument is reloc_eb. This bug was detected with the help of Coccinelle. Fixes: 2b35a512e9cf ("btrfs: qgroup: Use delayed subtree rescan for balance") Signed-off-by: Gustavo A. R. Silva --- fs/btrfs/qgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 8559ed92d708..16d7ec8e4a06 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -3931,7 +3931,7 @@ int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans, block->reloc_generation, block->level, &block->first_key); if (IS_ERR(reloc_eb)) { - ret = PTR_ERR(subv_eb); + ret = PTR_ERR(reloc_eb); reloc_eb = NULL; goto free_out; }