Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbcLDExS (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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 792 Lines: 27 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 --- 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; } -- 1.9.1