Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1632341pxb; Wed, 9 Feb 2022 00:39:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXHcHTooilGwfrForfqIFALmGN39dDgayGIGuv0yeuHrb9FlI+isx0YtNGQZtNVSefhCie X-Received: by 2002:a17:90a:548:: with SMTP id h8mr1348117pjf.109.1644395944430; Wed, 09 Feb 2022 00:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644395944; cv=none; d=google.com; s=arc-20160816; b=sM5GgPxs/aSNk0Lxy8yI2uOM5R/iFFeseLYJl2c+RHxuXT5qFMuBN1NMjKFL6qYL9A KgjQkE/Ksn05icAmZhWiPcfLHNAUuFF9uFL/URGeoUgTzP6Vgg3j1K++06O9zGC0s3Ck NewqRrMonknSuIpl2Zd9pB2XFUvkYbCzrAhAgu1vLSl1wYVuhqW1Zs5XWTs/ShM4qlgY JLMojF/WYHUPKSbrtTXfjLoqOvIstg+JfeeYz3XO77RhSqxEghlAfCw2P47zc2mb5ibj hEkIL+AsQQivj4UECwqxdukc7KAJUM5Bi/wAp6MrXbspbNUtZgVlxslawpISumsm6knK 3Zdg== 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=mxB0KPExZVCnvNVBevBxm6dpwpg7nRyeNdbCvrqbYNU=; b=zW6VDrbXzEWlKTeJ/J+ZNkw7F3DsDjHz0cIEQ7pS0+W+OI6Og1/5bkpmZ9rIV8vcAk lsBUyrBezZPhvXHz7lAayhb8NzJTuZE31HdIZN6R6hhulJLUV5yNr+j5LmtCSldf0IZa Fd2jg0nHaWv66cmEOt25+BhEJGqTV2z5tJw8uXGT8A5IqJ5UNZb8463OQbPrPdyD8Skb B96WuLu/65icYSkIUD7//LdatilON/B+h3rc1KnUSZkm5OksNDBzuMIsebnxzg5yTMqU n+KuBbteLdnLxNO2QMoXo22pE6ff2XE9u8we4gTjXX1ObUchJ5TSF3VgaNLsx6/lUEcX 7fIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCxn0wU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j6si466863plr.283.2022.02.09.00.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 00:39:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCxn0wU7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 73B2AC03648B; Wed, 9 Feb 2022 00:38:06 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390742AbiBGL5m (ORCPT + 99 others); Mon, 7 Feb 2022 06:57:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385201AbiBGLbT (ORCPT ); Mon, 7 Feb 2022 06:31:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76763C0302EA; Mon, 7 Feb 2022 03:29:38 -0800 (PST) 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 6DDEBB80EC3; Mon, 7 Feb 2022 11:29:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92901C004E1; Mon, 7 Feb 2022 11:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233376; bh=fvqCg9Xu5uhA5L3q+FEDsw1sBGuqJaYbDtNqhJQvLfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCxn0wU7G01L/P5qbqjZ3CHOwVt9T+C0+Nd6uN1NL5Wg1+JaksQFrT4q2cxf9HO6d hVTV6GPhNuSsHJ9Hs1NVQrBkuJiRYQJRk+fAfx/5PFetsX5PaQcqQj1jIWXSs0ypEK FQ+If6JKNbgJ81xGdG3WKmZ9guMU+FSEE42jV/Hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , stable@kernel.org, Xin Yin , Ritesh Harjani , Theodore Tso Subject: [PATCH 5.15 103/110] ext4: fix incorrect type issue during replay_del_range Date: Mon, 7 Feb 2022 12:07:16 +0100 Message-Id: <20220207103805.877048294@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103802.280120990@linuxfoundation.org> References: <20220207103802.280120990@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Xin Yin commit 8fca8a2b0a822f7936130af7299d2fd7f0a66714 upstream. should not use fast commit log data directly, add le32_to_cpu(). Reported-by: kernel test robot Fixes: 0b5b5a62b945 ("ext4: use ext4_ext_remove_space() for fast commit replay delete range") Cc: stable@kernel.org Signed-off-by: Xin Yin Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220126063146.2302-1-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/fast_commit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -1816,8 +1816,9 @@ ext4_fc_replay_del_range(struct super_bl } down_write(&EXT4_I(inode)->i_data_sem); - ret = ext4_ext_remove_space(inode, lrange.fc_lblk, - lrange.fc_lblk + lrange.fc_len - 1); + ret = ext4_ext_remove_space(inode, le32_to_cpu(lrange.fc_lblk), + le32_to_cpu(lrange.fc_lblk) + + le32_to_cpu(lrange.fc_len) - 1); up_write(&EXT4_I(inode)->i_data_sem); if (ret) goto out;