From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3950C00140 for ; Mon, 15 Aug 2022 11:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbiHOLXK (ORCPT ); Mon, 15 Aug 2022 07:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbiHOLXJ (ORCPT ); Mon, 15 Aug 2022 07:23:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B66AD2019B for ; Mon, 15 Aug 2022 04:23:06 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5138A61074 for ; Mon, 15 Aug 2022 11:23:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CAE7C433D6; Mon, 15 Aug 2022 11:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660562585; bh=ZlSdT0YNkEyTcjlwcw6Zux2f/5rE73Oro9UrWV/knPI=; h=Subject:To:Cc:From:Date:From; b=JMl8z1iohUrObkI9bsMOTsBW2deIhcFj6QoKmXK8yXyANHgEP085FtVbr7iSReQ4R F3jZprEt/5w6f77kXqaP1aTVRGH/001IWhW1lrI/krgOXwzZCjqhyx8GtlSc5YdJ7s zUz/ajb+x0dTgCZ1kfrtTP1RSjU36G7cmfp6JoS4= Subject: FAILED: patch "[PATCH] ext4: correct the misjudgment in ext4_iget_extra_inode" failed to apply to 4.9-stable tree To: libaokun1@huawei.com, jack@suse.cz, ritesh.list@gmail.com, tytso@mit.edu Cc: From: Date: Mon, 15 Aug 2022 13:23:03 +0200 Message-ID: <1660562583173134@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.9-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From fd7e672ea98b95b9d4c9dae316639f03c16a749d Mon Sep 17 00:00:00 2001 From: Baokun Li Date: Thu, 16 Jun 2022 10:13:58 +0800 Subject: [PATCH] ext4: correct the misjudgment in ext4_iget_extra_inode 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 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4bbce86b4ab0..641c9af91641 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4692,8 +4692,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);