From patchwork Fri Jan 24 09:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233140 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, 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 1D560C32771 for ; Fri, 24 Jan 2020 10:03:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1D2D208C4 for ; Fri, 24 Jan 2020 10:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860224; bh=xVseHo3iC0VmKQwVQd9GVtUh9UlSz4Qgxs9CZ+LjUdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KlB/Tm++LRScLOILsQ/VoK8KaUQ6TufI68NgTm5UJk8Smz4ItlnwI03XcHDThGXk8 cjSdVuAlWRkN5H8SDTlv13TgGYJqQT6zxC/dj3h2MKysl1z7S8OCfoC3xJXEpq66aM 14MRBKHOBmUvi3q9Fpl4hBHeUl0FyCG+WPs0Rl2I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388719AbgAXKDj (ORCPT ); Fri, 24 Jan 2020 05:03:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:39484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388615AbgAXKDi (ORCPT ); Fri, 24 Jan 2020 05:03:38 -0500 Received: from localhost (unknown [145.15.244.15]) (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 609C2214DB; Fri, 24 Jan 2020 10:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579860218; bh=xVseHo3iC0VmKQwVQd9GVtUh9UlSz4Qgxs9CZ+LjUdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GrejZw9osSZIrYGb+nNANWUvsyjbYjlcPy3CqFlVHSwAdkzCBQbSgRriSzzhjFSbn 4+X+4nbzvD/Fo+fuM+6ftkRZEgl4/XxglZGqQlN/LjFWVBubZ6+aI0jDggD2F1ZDEo ztwBfxBgp1NWhFjuA/70t/FVD0yPVPDUYjupR/5A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Theodore Tso , Sasha Levin Subject: [PATCH 4.14 269/343] ext4: set error return correctly when ext4_htree_store_dirent fails Date: Fri, 24 Jan 2020 10:31:27 +0100 Message-Id: <20200124092955.347763301@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092919.490687572@linuxfoundation.org> References: <20200124092919.490687572@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 137c752ab9853..6064bcb8572b3 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++;