Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3402967rwa; Tue, 23 Aug 2022 04:18:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR5gEW2TfnmSdxk/RA+JH1Zk4QLM+HmWho2enZ8JnhkObS6uejV5KFZwfgF2xPbvjlWQKvPA X-Received: by 2002:a17:90b:1d0b:b0:1f5:6554:d556 with SMTP id on11-20020a17090b1d0b00b001f56554d556mr2853883pjb.168.1661253528841; Tue, 23 Aug 2022 04:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253528; cv=none; d=google.com; s=arc-20160816; b=m/xbvkgfH4SDcq7jjLoKAqsPaGUR54LTbUw91ZSv9HQegxMgggXnmsY6sWIlRTTRFL fDk0WO0ScuSJj1wnV66rBWjzcVuWYV6oO7dzpG4tom2KLHlj/iZfZmqy0JOczi4JB4cb 2wP0BdcXv/pmFLP92c/mVRzD+xfghGs3DewnRlrUJra40XH4dIJDf6n3W55ZAQIMiQAS iovT7Ia/J0eDHfsolkZyQsx4TuMZyHrmdT3c5jrSCNvyOESLUDItIB7llIVOdzltdEwh xJe8hM1ebKSJ+IBv0JO1xnn/hZQT+3uu+ICqVSI3VS4kC4xUhTJ4iZtVY1lrJUqr5bdk KZXg== 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=XjXG18YQXcq6mLHN4Fmd625PYDneqTqajfSEf8NAhyA=; b=ZJAkDsfMjuOxCHSR+SsUjzqhJ0i16E3Xn3CmGGWH37LZWKjoSXJBbVjonPRYU9s4L/ qSNGnqZwl3seVyXaoo6rdc27wFjpCliqXF+v0lzBB69d5lw4CP1hOGq/741W+pizJy8a WAW4t9+3V4tlvsF31htjVrzrmQNMCisgvEmkHeRr4m2jR8LFie90UrhNFi/CMcYFY6aY R0IO9t+/6IB4PXRmZgVmXnHjGIJQLM558dlYS/5K02HEwTO6nj7s02XyifkOyqYtuvlj hcOCCXKT431Z3Yh8RQFuh2o8+SjTfNy/BltXMxjUQTLQZqTK46iTD2PUMYP8PGi6boff W5Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QgMBLFMh; 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 129-20020a630187000000b0042a81e05245si9174083pgb.443.2022.08.23.04.18.37; Tue, 23 Aug 2022 04:18:48 -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=QgMBLFMh; 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 S1356215AbiHWKt6 (ORCPT + 99 others); Tue, 23 Aug 2022 06:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356550AbiHWKme (ORCPT ); Tue, 23 Aug 2022 06:42:34 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08CD58672E; Tue, 23 Aug 2022 02:10:03 -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 77C12CE1B40; Tue, 23 Aug 2022 09:10:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71F26C433C1; Tue, 23 Aug 2022 09:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245799; bh=oBWPVa+/s0Zsff8K0UJpXwNYvvBDOEBsVZDbzO/5imw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QgMBLFMhRbePs72q98Gr36FUPfpBi8ecNKhmXzKrMGbMEBTAl69XQ28to/XDrhwg8 dGtayjfWs8hqwd6Izb1UO5YEI/AIWnzbUhpMSNvPzuSYD0QTdwL3i8+ANxKr1cDIpw fzh/XkCekQ5uIQEVUmj8+n/MAfSbgHH1v/HMvCqI= 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.19 193/287] ext4: correct the misjudgment in ext4_iget_extra_inode Date: Tue, 23 Aug 2022 10:26:02 +0200 Message-Id: <20220823080107.338891250@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 @@ -4844,8 +4844,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);