Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6053417iog; Thu, 23 Jun 2022 10:20:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vamoRG9omyTH/mvljxkpQDiRphakD+FQqyIjE2UnpA4kNgFrbUniG9tRAAnlZ7XkUHVpBm X-Received: by 2002:a17:906:7791:b0:712:1c42:777a with SMTP id s17-20020a170906779100b007121c42777amr9437681ejm.68.1656004811167; Thu, 23 Jun 2022 10:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656004811; cv=none; d=google.com; s=arc-20160816; b=nnsUN8iGKj7Sm5fAmvDNiPgoSYu9rQjR8ZfCt82WFVb7sgZp6biJG19Y2eGhEGODbk DiInUp6mMkSKVjeUrM+Cw4+1gBsuYcCmCHw7AxaKqg37cZAI1JbWdm0X1jtSr5adMO/k bse4BnMVLkkxdCkl1LOyxzBpctF/TQKd58SkXEXiRjsi6DEfyNNZP0NNMq07xi41mjLv EZkO2KW5SWmnxF1aUJRf3/TkhknKahjWsxolqVMAGXnT+8+TL9JtbVazXxhABLcYPGaC pt+Ldt6ip4USCTHHUvZj4BAMKR6n5KMYV2g8274ziGbm+AmiG8fb9c6usVwTTxgwk7Ao VVBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XeIDnY5A7pJDyJ+ZPJArmQLkDNCUHrMZSXUmOo9TtOk=; b=aGfViHYZg+n9MdmUvtrx4TVRk3T+hgDj6LZlMfL6rNUMeqQlJB0YJS8mHMlvQVjxh+ Y4l9CroG2EZfOQNBqGFc0F1RGrLzUxvUEFwNA9lkDV6TaNeCyYAFgTdntEb5dPvBaATA tdKjVN07UTc6phufE3yoJZR4COHSAET4+hZDgnfkM7A+J/rH4XBSu8EykKOnFUSzT8/4 Cmv59yU9GWI7zlyNCXbQ2AZCSYZPliMRpigzYdrR9JYM6yCvJWCEUqS/BfV9hyKJ6Te/ ed6xQHAnZDRFdG9Dns05HXLH02SNzMbAWvTqYwObIM5t/gfPE/QXnH5wb2xmkFL4oDme AuEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NGGrGXOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t27-20020a508d5b000000b004356eb98649si157294edt.174.2022.06.23.10.19.44; Thu, 23 Jun 2022 10:20:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NGGrGXOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiFWRPE (ORCPT + 99 others); Thu, 23 Jun 2022 13:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232735AbiFWRM0 (ORCPT ); Thu, 23 Jun 2022 13:12:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C18DF2DF3; Thu, 23 Jun 2022 09:57:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A643FB8248C; Thu, 23 Jun 2022 16:57:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15030C3411B; Thu, 23 Jun 2022 16:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656003470; bh=DXBUbvkk4CdCgdHzMDE41vC7EXTzA7k4HO01SBDNL7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NGGrGXOgHybZ4XHz3X8eUAB5qZcq0lmtYKof/OeuYr0QQVaeaY3q3o3Ff9XrSALrV ESCMCdPxgZKoFeWt4tVsb1/BFyCMUYQKgx6Xlt3VhfT99qIKc5gaiAIwUNPTcDfG9H M9eCA0oBCf5e22+bbwS0og1OL5LtLdqOtd01xHsE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Ding Xiang , Theodore Tso Subject: [PATCH 4.9 248/264] ext4: make variable "count" signed Date: Thu, 23 Jun 2022 18:44:01 +0200 Message-Id: <20220623164351.087369319@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164344.053938039@linuxfoundation.org> References: <20220623164344.053938039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ding Xiang commit bc75a6eb856cb1507fa907bf6c1eda91b3fef52f upstream. Since dx_make_map() may return -EFSCORRUPTED now, so change "count" to be a signed integer so we can correctly check for an error code returned by dx_make_map(). Fixes: 46c116b920eb ("ext4: verify dir block before splitting it") Cc: stable@kernel.org Signed-off-by: Ding Xiang Link: https://lore.kernel.org/r/20220530100047.537598-1-dingxiang@cmss.chinamobile.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/namei.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1726,7 +1726,8 @@ static struct ext4_dir_entry_2 *do_split struct dx_hash_info *hinfo) { unsigned blocksize = dir->i_sb->s_blocksize; - unsigned count, continued; + unsigned continued; + int count; struct buffer_head *bh2; ext4_lblk_t newblock; u32 hash2;