Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3084598rwb; Mon, 15 Aug 2022 17:45:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR72OQkHNBAgMiL2WBHd9T08t/tBrGv4rXJR3+UOSAJUvDgoUVAptLWNd6oR6a+7G1HmfCHY X-Received: by 2002:a17:907:728d:b0:731:8396:ea86 with SMTP id dt13-20020a170907728d00b007318396ea86mr11953771ejc.361.1660610706595; Mon, 15 Aug 2022 17:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610706; cv=none; d=google.com; s=arc-20160816; b=df/IhIdjNllRVm80zg0/RMseMdMwZN2RT2TOgUCLImbOSeAQJ9EkiT93fuliL2geAb pDEZ9IngqkaupyEVSZ8dWSlQmktRfLBb2F62PAvdqx5rjVDr4uJhAQNr8ackt2F6Kkxq VE1BUBvl6A0S83RADWhI/z6TWf56p5UPlYuSVjgkCWQZA525TKpPtSbFE8XHR3Z/zSs7 GyMvTmmR7AKvICMX9nghTvlFqTU4mVKEF9bKeiy3JxQRks9QAwb89CoyXK8RSCcSUcOT k+MnEI7nhAS5hFwJm9cxLqMeedXVLcg1YPSDtTAaLi1u9qJRotwa+D4xa8lhoAKar8u6 BuDQ== 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=QYh72dZmjo+8pZySiUXH+ANm1efXVUG8CElbBrcmm3c=; b=PEONkqNe6ctA+x2sxGkgCCLk/zB06NOKd/47zlcYIhZD6rEWoE+lFH8fIaV37qS01e Eab1e9rCyqNXZFJ9fez5c0uOwMdAwctimXEEo4IOlwV7KxUIkiRDFcC5HjDOZ1v5sBrY 9nE7wnF3eE5pKMwTMBlrTcZ8ygAw/hiXo6jhsUENW0rFLxjv9yN/93gPwmJnt/NePgFh g24jpEzHBrZvRqUExZObkhlfwQJa193YODLBmG9f369Nriz41ZnTquPMv4vft88vrGh4 gEPqiONkMWxZFv6uFuvxYATJvv32nO5n6Wn3KH+8vb+YBa34iE2nwiG4mvKe1iNIzbKj DGlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YMzUsz9j; 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 m7-20020a056402510700b0043c25d25046si10093170edd.249.2022.08.15.17.44.40; Mon, 15 Aug 2022 17:45:06 -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=YMzUsz9j; 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 S1353834AbiHOXij (ORCPT + 99 others); Mon, 15 Aug 2022 19:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346117AbiHOXds (ORCPT ); Mon, 15 Aug 2022 19:33:48 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29371959C; Mon, 15 Aug 2022 13:08:41 -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 sin.source.kernel.org (Postfix) with ESMTPS id 9314BCE12E7; Mon, 15 Aug 2022 20:08:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C9D3C433C1; Mon, 15 Aug 2022 20:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594117; bh=ZnymPQFspFL40QedNmT9etLRZlQVld7+zT63dbaFmGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMzUsz9j5m0iYJLWSAcTvkT/q/QWJEfqkMnKunDnDMCaa9+8Mgaq9md6co5dJDGIp zNWJMLZipHn6QDhOnZbmavBz7E43vz4XJ+WQZPt+FNUjaLmXBjvdkwVZaAA06nDvAk anBUxQOrxq8FRgk2qaLfh6ijLq2uWIWlE+Xybo0M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Baokun Li , "Ritesh Harjani (IBM)" , Jan Kara , Theodore Tso , Sasha Levin Subject: [PATCH 5.18 1059/1095] ext4: correct the misjudgment in ext4_iget_extra_inode Date: Mon, 15 Aug 2022 20:07:38 +0200 Message-Id: <20220815180512.842967020@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Baokun Li [ Upstream commit fd7e672ea98b95b9d4c9dae316639f03c16a749d ] Use the EXT4_INODE_HAS_XATTR_SPACE macro to more accurately determine whether the inode have xattr space. Cc: stable@kernel.org Signed-off-by: Baokun Li Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220616021358.2504451-5-libaokun1@huawei.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- fs/ext4/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 826e2deb10f8..e478cac3b8f2 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4681,8 +4681,7 @@ static inline int ext4_iget_extra_inode(struct inode *inode, __le32 *magic = (void *)raw_inode + EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize; - if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize + sizeof(__le32) <= - EXT4_INODE_SIZE(inode->i_sb) && + if (EXT4_INODE_HAS_XATTR_SPACE(inode) && *magic == cpu_to_le32(EXT4_XATTR_MAGIC)) { ext4_set_inode_state(inode, EXT4_STATE_XATTR); return ext4_find_inline_data_nolock(inode); -- 2.35.1