Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404039rwa; Tue, 23 Aug 2022 04:19:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Hio5b+KwAcvjikt95TTzLnYuWXN0FumQY5vdLoPZu7z1wI4VAuFTKuj7qs9OBtipnb2Rk X-Received: by 2002:a17:902:d2c8:b0:172:f0a1:4d4d with SMTP id n8-20020a170902d2c800b00172f0a14d4dmr7292462plc.142.1661253592631; Tue, 23 Aug 2022 04:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253592; cv=none; d=google.com; s=arc-20160816; b=MJPhVRWascVtv66h7d349KEcLWyA3DKmlQkhBQ9mwjXyiABTWPiUXBFPmahstjZsQV CmGmBIi0/EUm1KRCfk1R4TFPn4djbIBmxE3tqhwt/Q9GxadYVML0AeGk0eZQd4PTmW6r NoGJfivq6MyTEgVTFg82pJWDT8bGaPv1XIgMEtllykz9jd0Bd6fuPYVXNfWktWekFkTT +izUq9v6b5S0eCQi39dBiF+Q7nbPX7/GNR5joLlYiPPGn1IdGdgb0aR9sx3Ipcn5QOSj N2Xu4bIPieXM/hGO0X9vtF5umIiXwZ9vGLnTQVvCRuVq6NFH0efIs1rhZWjIe3shvjEM uLgA== 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=tg7bB56tywo1qgtL85xAdSjMkT7QJUFlQaQuvGuNOVs=; b=fn9FzOdnj5r3sZQyXuXlBRtdP83u8AMMFRPI4yj/3F4diarVyIUYuEs3kvKsv2HQVt tVJHP0mMKMU/MBerVhj6R3DkJsXHTc/3vzYuTcgP3ecamoPPZ7RqPQtztH36rRmyvZGj lQkguW/amXknwIWLDVkuM4zEk7y1F+yNEdJLUL40Axv3cMlCx4LLwU8JYOLmGyneiZob dKv66+/NrC3X8shvsdbuF2zQDK/N3Y5MwqN6ypuztdPg7Yt9rgnaOi38WpqTw1poD8I6 j2nbFJWdUTuZy2s4/udttl4D5Vq5pY9nIHbf9opVxln9PrApLssEWbfxKAQye63W/I0H wnAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="LLs/IQvy"; 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 o12-20020a1709026b0c00b001728fede5c1si11898502plk.174.2022.08.23.04.19.41; Tue, 23 Aug 2022 04:19:52 -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="LLs/IQvy"; 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 S1353151AbiHWKK4 (ORCPT + 99 others); Tue, 23 Aug 2022 06:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352830AbiHWKCe (ORCPT ); Tue, 23 Aug 2022 06:02:34 -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 CFC177C53D; Tue, 23 Aug 2022 01:51:02 -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 2D172B81BF8; Tue, 23 Aug 2022 08:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EBC8C433D6; Tue, 23 Aug 2022 08:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244659; bh=N+m636UE15ZLpNywr+fbVOB/mn0j1i9xnTyDMEwWYMI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLs/IQvyHSYSOkHyvbTklvz2/yz03xVVVKIu2mtXJCfAyMcwleEh4u1vC7GOZBsV5 9DrEs3go+hMuHBpWuW7wrl7IicjhL1WMEWGlY3eTCjo+GWLwk3j+49HkTK2599Eo0j DeO1lGLOs4U47KWc6+feVW6mTZtzIFLQJfk3vj3Q= 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 Subject: [PATCH 4.14 158/229] ext4: correct the misjudgment in ext4_iget_extra_inode Date: Tue, 23 Aug 2022 10:25:19 +0200 Message-Id: <20220823080059.324006952@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 commit fd7e672ea98b95b9d4c9dae316639f03c16a749d upstream. 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: Greg Kroah-Hartman --- fs/ext4/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4735,8 +4735,7 @@ static inline int ext4_iget_extra_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);