From patchwork Mon Aug 3 09:35:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 11697719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFCE7138A for ; Mon, 3 Aug 2020 09:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF30F2075A for ; Mon, 3 Aug 2020 09:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726190AbgHCJfL (ORCPT ); Mon, 3 Aug 2020 05:35:11 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:54180 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgHCJfL (ORCPT ); Mon, 3 Aug 2020 05:35:11 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 5D4331C0BD4; Mon, 3 Aug 2020 11:35:08 +0200 (CEST) Date: Mon, 3 Aug 2020 11:35:06 +0200 From: Pavel Machek To: clm@fb.com, jbacik@fb.com, dsterba@suse.com, sashal@kernel.org, wqu@suse.com, nborisov@suse.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, jungyeon@gatech.edu, stable@kernel.org Subject: [PATCH] btrfs: fix error value in btrfs_get_extent Message-ID: <20200803093506.GA19472@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org btrfs_get_extent() sets variable ret, but out: error path expect error to be in variable err. Fix that. Signed-off-by: Pavel Machek (CIP) Reviewed-by: Nikolay Borisov --- Notice that patch introducing this problem is on its way to 4.19.137-stable. diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7befb7c12bd3..4aaa01540f89 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7012,7 +7012,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, 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));