From nobody Tue Dec 16 11:44:01 2025 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 67000C32771 for ; Fri, 19 Aug 2022 15:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349308AbiHSPrw (ORCPT ); Fri, 19 Aug 2022 11:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350143AbiHSPrH (ORCPT ); Fri, 19 Aug 2022 11:47:07 -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 9418E6EF11; Fri, 19 Aug 2022 08:46:51 -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 F373EB82811; Fri, 19 Aug 2022 15:46:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 474A1C433D6; Fri, 19 Aug 2022 15:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924008; bh=inlHmPP1FVIWgYLUIgSMjotQGnUyGr0HMWijxVlg7Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J2XUdwwf5xyGARhx0uSwHzKRgIJaBkIB2D4PLmg8K8vIjerK37dfI9IIQZwxv+B4T c7072AxpXbGmKFiPK4Qv1UManUWVkZgyrl+65sdQOG7/eH7xe/eZWmcdZWQCTEbzvo zyYGGPp8LWaBWhWZp9JDBAI2cfMU7sgVrJ3QiapQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Chinner , "Darrick J. Wong" , Amir Goldstein Subject: [PATCH 5.10 025/545] xfs: fix I_DONTCACHE Date: Fri, 19 Aug 2022 17:36:35 +0200 Message-Id: <20220819153830.321012867@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dave Chinner commit f38a032b165d812b0ba8378a5cd237c0888ff65f upstream. Yup, the VFS hoist broke it, and nobody noticed. Bulkstat workloads make it clear that it doesn't work as it should. Fixes: dae2f8ed7992 ("fs: Lift XFS_IDONTCACHE to the VFS layer") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Amir Goldstein Acked-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_icache.c | 3 ++- fs/xfs/xfs_iops.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -47,8 +47,9 @@ xfs_inode_alloc( return NULL; } =20 - /* VFS doesn't initialise i_mode! */ + /* VFS doesn't initialise i_mode or i_state! */ VFS_I(ip)->i_mode =3D 0; + VFS_I(ip)->i_state =3D 0; =20 XFS_STATS_INC(mp, vn_active); ASSERT(atomic_read(&ip->i_pincount) =3D=3D 0); --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -1328,7 +1328,7 @@ xfs_setup_inode( gfp_t gfp_mask; =20 inode->i_ino =3D ip->i_ino; - inode->i_state =3D I_NEW; + inode->i_state |=3D I_NEW; =20 inode_sb_list_add(inode); /* make the inode look hashed for the writeback code */