From patchwork Sun Dec 4 04:51:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pan Bian X-Patchwork-Id: 9459887 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 448E360459 for ; Sun, 4 Dec 2016 04:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 354C22811E for ; Sun, 4 Dec 2016 04:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29F6228173; Sun, 4 Dec 2016 04:53:31 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 310F528156 for ; Sun, 4 Dec 2016 04:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbcLDExS (ORCPT ); Sat, 3 Dec 2016 23:53:18 -0500 Received: from m50-132.163.com ([123.125.50.132]:52499 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbcLDExQ (ORCPT ); Sat, 3 Dec 2016 23:53:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=vOdUDM6TdvhH1rwssK 6kDoqci1LgP2JOBUWUtMw4GiA=; b=WIW1coBrZ87flhOZb3jk1mIFgJ0s4ShvkY ZaKRFEshgkB6E0U+QVwZ4eI0gjb9EnRrO1NOaMc7Q/F9Wps7pwkXmLGTm5mSlfeL PKKbPCGAzwLTbQcheyUj2Z4ym8sXjeVUMux/jjTCHAdBP5jtcZYB2aWixjVxDKHd nQVJfd31o= Received: from localhost.localdomain (unknown [114.243.30.33]) by smtp2 (Coremail) with SMTP id DNGowADnSvDooENYTMyjIQ--.27890S3; Sun, 04 Dec 2016 12:51:55 +0800 (CST) From: Pan Bian To: Omar Sandoval , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH 1/1] btrfs: fix improper return value Date: Sun, 4 Dec 2016 12:51:53 +0800 Message-Id: <1480827113-3928-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DNGowADnSvDooENYTMyjIQ--.27890S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4fZFy7Ww17tFy7ur17Jrb_yoW3tFg_JF yxA3ykGF43Jw1kurn5GFZaqFW2ga4jgr1Dta45GFZxKw17Ka15ZFn7Xrs0kr1kZa1SgFy5 GFZaqrZrC3W7CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUe2jg3UUUUU== X-Originating-IP: [114.243.30.33] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiQAw2clSIRSOM2gAAsk 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 function btrfs_uuid_tree_iterate(), errno is assigned to variable ret on errors. However, it directly returns 0. It may be better to return ret. This patch also removes the warning, because the caller already prints a warning. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188731 Signed-off-by: Pan Bian Reviewed-by: Omar Sandoval --- fs/btrfs/uuid-tree.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c index 7fc89e4..83bb2f2 100644 --- a/fs/btrfs/uuid-tree.c +++ b/fs/btrfs/uuid-tree.c @@ -351,7 +351,5 @@ int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info, out: btrfs_free_path(path); - if (ret) - btrfs_warn(fs_info, "btrfs_uuid_tree_iterate failed %d", ret); - return 0; + return ret; }