Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1577920pxb; Tue, 8 Feb 2022 22:56:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMH2vQhfJQbelXla5OdebN3VPrynd73//rMXe7jN1pCFVEjI2XY15hVtiByzRD2mhUZFEk X-Received: by 2002:a63:6bc2:: with SMTP id g185mr811945pgc.480.1644389774748; Tue, 08 Feb 2022 22:56:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644389774; cv=none; d=google.com; s=arc-20160816; b=JW42dcNUcld8JIBeO+jYQ7ax8ZOdSvIb5qkviN+24PMqGDCbWiiq2dfaSUpWkpZZWS ApBNb+jrf1TR6orf3MpCyKpGSaA6rIAcQY7TlyjajPsptH7wzy1k/t0CubieRW2gToIL 8iaF7PV1WQMgP0sBgAUzf9ANtKXwaoH5ThWW3f0MH0MisSXunOhtvhR2z0HBo6FFwxkr kd3FVF3qIPzMbPhpaBe4OlKfFjzf5GaG2wh4mxa0+gilmtHElhx0W0PYsAk5fUdN89qq fo9lhuKGRxcOvgM0nmOlFcf5kgPo5Dz8VXX8oSoi7nxr7YDEK7y3KzFk/hjfRHNp1V12 a3lg== 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=mRkZLjkI97LmY7PCPLwhzK9SA5jFFFAnTw75xfc9tCE=; b=O9IOSpUqhNeaRVoDJqJmCnGoI7dkYEry9H+wBCHfU3hiRzsbYsu0IleytvJ0FuGJXN PXL+DTLOst8ZEm6Ta3qy+QAZxRYVGyoo9MncxqueGrIByGvtMZIpYDn4xu6ZlLgc4E30 6I//53HSLoeeSckPIc1VjocRHo3H7jcZjKdQ+hqAr1plLRyau1+S8HvxhSyftZHKcwLd jFcN3OAI+t39aXRrUHWcR3SzZS6ix1cCZBaB94kb6IV6crC6s9dC00v0+jfP4EQgal7m xjcsypq8Zwu+54INwvbQypJvMxCMW7nVIzt7KWP5yryEaxqgSa/yyAtLfHvWOIqCvPSM 0UQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vG77KdU+; 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 e13si12963500plx.19.2022.02.08.22.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 22:56:14 -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=vG77KdU+; 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 0B392E06DFB1; Tue, 8 Feb 2022 22:36:37 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382019AbiBGMAl (ORCPT + 99 others); Mon, 7 Feb 2022 07:00:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386748AbiBGLgb (ORCPT ); Mon, 7 Feb 2022 06:36:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 026E9C043181; Mon, 7 Feb 2022 03:36:30 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8208A60A69; Mon, 7 Feb 2022 11:36:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4948FC004E1; Mon, 7 Feb 2022 11:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233790; bh=rrCuu477wj4X6lM0wC9UJqAp+SzH0iPa855DMsGM5eA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vG77KdU+pylEYjlWOPzMxMSbX14SwUoD5v7P5xZOLe/pWjKIHyCcXzjAAtITeRoGa X0c2tLjZ5MMEwWj8YHKKaWxNMZ3afwq8huyP6jLe8oPlxvEAhVrbNbVCsdujIvcBFd JI8OoSDS2Nk9KLPb+KutkijQ+6D6AWYBsA/AYKKA= 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.16 119/126] ext4: fix incorrect type issue during replay_del_range Date: Mon, 7 Feb 2022 12:07:30 +0100 Message-Id: <20220207103808.170434877@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@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.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 @@ -1819,8 +1819,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;