Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1199741pxa; Thu, 20 Aug 2020 05:27:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzU+U0GW/GXig+lYKqgOEBPCea/DmXuOs1PFcBIL+4FVuLOuvzOnt8FX1atyY9a3bpqloP X-Received: by 2002:a17:906:840c:: with SMTP id n12mr2892529ejx.246.1597926466988; Thu, 20 Aug 2020 05:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597926466; cv=none; d=google.com; s=arc-20160816; b=Qb6hCuR6sW+DA0Zyy1Z6FxKC3+w2++L41t61OcthR2/kYI5R6TBXCy4XpA9y8nisRa 2hNp/HtO2ZpBT+8u7hIcIoRhazbiGIgoKx8xRN84wzzPVtAYwBTkM5vZdk+QdmVOkUDs LbLu6kc/TCu2lRMMP/WflaSmMQjmJXOd5N6vO+g90Ej1bhH07Kk6dYY6uteaGvmnhLKH fzvy9wLatwRb8x1A556bBPtlvRnXCXh/0WVwayJ970jd++4kqH8YvBqmSKgESzbilK57 O4qWrDrUVErRhYhAJZA9wJeJy+f9e/jnPodFeH29ObaNdtW9MqH3cMCbd9XyDRoPAapV u9MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=as4sA0CHnaUN/nxZpIhjQ9Dl5YY5ezhtNc0h/W7mDeQ=; b=RhRNYU1iifysMijZk2ROdNvAQ3hEzSYwmqty31eRVnVEQhehykNfwvNhTVOly0aKTy ocnX4FXcPC7tTlMnjcPpTlXtPYGKrnWcCCl1CNVYQmEp2cjSQPdUCm1tH/zTpZszHdMn Mh7FB5Q/hEgbvY5iGr8mIaxO2jaqey6VrFqgLjxkqub/WeL3tTPkjVpBYKhXv8E/5CSK J/7QusFWS2Y/HDbcngx+A/bFFAE0FNOQLkEHxVB04uIB9tixm4t52L2c0IAMFbOa4vxV dh5vJ4JWxzsKhh9y8oc1Lgz2I11kvfgKXBxuykTmvUZnBRe9373H0pmDfxYFDxrIklWP qR8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EUVejZn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si372156edp.293.2020.08.20.05.27.23; Thu, 20 Aug 2020 05:27:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="EUVejZn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730239AbgHTMYj (ORCPT + 99 others); Thu, 20 Aug 2020 08:24:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:35826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730071AbgHTJxo (ORCPT ); Thu, 20 Aug 2020 05:53:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAF0821775; Thu, 20 Aug 2020 09:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917224; bh=ng2dWQPIygJnSwEabXZLLCmhiuRhUXoVKVZys+erk0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EUVejZn/cAiveBWTpASi2nk6sFV7RMmEVlhpVuasLyXX7Iv2BdAhuuxkCaEGJX+eO QSFx3Cwo/4OCBXwaa0GmkXeW+EHfCLzxFlaviOK0Bd86GxJu6yDIu8IqBWeo7tNCvg fNpMTSzLzlkApPdzrLfdpFGDBowhDADqj16Wdbo4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikolay Borisov , "Pavel Machek (CIP)" , David Sterba Subject: [PATCH 4.19 17/92] btrfs: fix return value mixup in btrfs_get_extent Date: Thu, 20 Aug 2020 11:21:02 +0200 Message-Id: <20200820091538.452622277@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091537.490965042@linuxfoundation.org> References: <20200820091537.490965042@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Machek commit 881a3a11c2b858fe9b69ef79ac5ee9978a266dc9 upstream. btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err so the error code is lost. Fixes: 6bf9e4bd6a27 ("btrfs: inode: Verify inode mode to avoid NULL pointer dereference") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Nikolay Borisov Signed-off-by: Pavel Machek (CIP) Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7014,7 +7014,7 @@ struct extent_map *btrfs_get_extent(stru found_type == BTRFS_FILE_EXTENT_PREALLOC) { /* Only regular file could have regular/prealloc extent */ if (!S_ISREG(inode->vfs_inode.i_mode)) { - ret = -EUCLEAN; + err = -EUCLEAN; btrfs_crit(fs_info, "regular/prealloc extent found for non-regular inode %llu", btrfs_ino(inode));