From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE6EFC33CB6 for ; Thu, 16 Jan 2020 18:18:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C25AF208C3 for ; Thu, 16 Jan 2020 18:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579198728; bh=Upsc8dUypMFUiVc2zLPLgZ8S5/S1QGnMtIRlKiGu8eQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Cu6O9c8yh74YTJx3WpQVktALBZm+YczFkCQQpBNyqY2FJaqK6xklo2p3hlJ2NGE8/ jVeZRHC97L5amal1jcUZuYVSiRLOAwNMcGMYyIpWEvGTNO/EznoM5cY5j5BP5W0SHq 1VsvVSU3WMw+xznPP4HoDfFSoFBEjDBcTEjVIJnE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392639AbgAPR2n (ORCPT ); Thu, 16 Jan 2020 12:28:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:40002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392630AbgAPR2m (ORCPT ); Thu, 16 Jan 2020 12:28:42 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5422324701; Thu, 16 Jan 2020 17:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579195722; bh=Upsc8dUypMFUiVc2zLPLgZ8S5/S1QGnMtIRlKiGu8eQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jzcYygeydtBBdaNvgnOaN7BcpUf0yJXxbyvYJO6ewccwrd+viV+somMa40q8AkQij shBshPQqU7s6RDLH/dmJeW6asGpegO+RinnmViqg+C2LC4r0hxCiSQW5AcE+RL6aP+ zoS7RTYNX1kHQkn4Ovlmt8qIEGpAm72V0I1BazEE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Colin Ian King , Theodore Ts'o , Sasha Levin , linux-ext4@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 264/371] ext4: set error return correctly when ext4_htree_store_dirent fails Date: Thu, 16 Jan 2020 12:22:16 -0500 Message-Id: <20200116172403.18149-207-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116172403.18149-1-sashal@kernel.org> References: <20200116172403.18149-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Colin Ian King [ Upstream commit 7a14826ede1d714f0bb56de8167c0e519041eeda ] Currently when the call to ext4_htree_store_dirent fails the error return variable 'ret' is is not being set to the error code and variable count is instead, hence the error code is not being returned. Fix this by assigning ret to the error return code. Addresses-Coverity: ("Unused value") Fixes: 8af0f0822797 ("ext4: fix readdir error in the case of inline_data+dir_index") Signed-off-by: Colin Ian King Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 137c752ab985..6064bcb8572b 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1425,7 +1425,7 @@ int htree_inlinedir_to_tree(struct file *dir_file, err = ext4_htree_store_dirent(dir_file, hinfo->hash, hinfo->minor_hash, de, &tmp_str); if (err) { - count = err; + ret = err; goto out; } count++; -- 2.20.1