Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1271757pxa; Thu, 20 Aug 2020 07:13:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0Zr0apsxxcfRmrSpGZ1wJ5iQlHC5pk3y5sRnSf8VyCBFIgNSXKtptfbHxjhBBhdjvGAx2 X-Received: by 2002:a05:6402:1443:: with SMTP id d3mr3217908edx.40.1597932828196; Thu, 20 Aug 2020 07:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597932828; cv=none; d=google.com; s=arc-20160816; b=LE2GSUjXJTIaWwjiay7cHtxlLhEIMWePxBzCgaHo34SUmCEPsljkO4Kn+K33IVaRRt Lef1UXY1bDnjILhlGPHlVNnHnlTwysbTvY0pCkul5k1WvQfMfMgfTtR/KP9h9dRn4Ssp OS5sEmfLSn0eUc453ifE30cF0WRdSbF0J6jCLJgrmixS7OqscYMDqNEwX/WDoSRqqEfn n4WV04MqaQbQWZPF3fui6WVoDEe9A5uvNnwjdEuSRfYuCpFzA67a2HfsSA4h7nNxYxHQ bRlc1iEi0fsIA/nYMYSMWlOv6Xhehvo5fW83seLIMSgb6kiZBkB0ueDgvP2qmJVIN1lQ tAXg== 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=fdzaVEL9FN+PPpkQWHrbz3MK7xrShXjNeM1yXvPvThw=; b=yIUaY1BleajqNubBRuEyL+zjc1hFC2IYkUGZYYqxK7bPZbBhfD3ht/rtOyGBUj7TrR RCth2yLY7mVmoYMpTetvF42Z5J37Og+xWPv/AJpcfEiJGPA586Bqlg25xrPim6ue4yZg syEGww4C2k46T7qGT2+MPTI3/y/gorFgddCsX+JG+m8zL8XaAFVnBOndoymXAPCWLUmm q/50zhUeepoWjSA1s3yQbL0+ADp3KRxN6OSbJkWQC1z7GknFq6WZJQotk5zMl1KaCy7F 5M4lhzbI2Sb0BCV5vWV4RPnUEWhkms6rtD29qXz9RTQUw8uO5iCRwGA8aJnY3VFqhDSv VGLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XZ5m2WV0; 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 a20si1435762eda.489.2020.08.20.07.13.23; Thu, 20 Aug 2020 07:13:48 -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=XZ5m2WV0; 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 S1731092AbgHTN5o (ORCPT + 99 others); Thu, 20 Aug 2020 09:57:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:33584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727082AbgHTJZL (ORCPT ); Thu, 20 Aug 2020 05:25:11 -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 E507D22D06; Thu, 20 Aug 2020 09:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915511; bh=n+bFE19RYFdmUitLKIeuB0F/v5riP9D6Ndz7V4OtSPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XZ5m2WV0ikJs5TVxy5gho3qvbMd4tFXcq/XKC3C+d/eCTWJyvEpmrGz5c29mXmyYv giOwUO0S345f83QFEby3VlCqktFlfETwtpTgZGEe2Zj/Vgesrn5+zzSGnN3Je2OBho 9xnTL7t7cQHtmeN8Re7gYJbJVW+J86z1x1vfACqQ= 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 5.8 040/232] btrfs: fix return value mixup in btrfs_get_extent Date: Thu, 20 Aug 2020 11:18:11 +0200 Message-Id: <20200820091614.719236930@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@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 @@ -6633,7 +6633,7 @@ struct extent_map *btrfs_get_extent(stru extent_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));