From patchwork Sat Oct 22 07:20:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1104899wrr; Sat, 22 Oct 2022 01:33:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PBhzznxFbK8cGSMTWUTUN1++/OyUIPmzzo46bQOoN0VWyP/P7w3Lpht+Tkm4FCmi1yOnz X-Received: by 2002:a17:902:7c11:b0:178:a6ca:4850 with SMTP id x17-20020a1709027c1100b00178a6ca4850mr24098543pll.111.1666427619268; Sat, 22 Oct 2022 01:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427619; cv=none; d=google.com; s=arc-20160816; b=oh5DiM5XgbXU/daSDYooiA9gytZEKxUvjWX7WG/7URzv/jyzWQ+zje3fRJhkjG8gwx MIBfXJhUcsNadvg5e9a8jBQDKERXuV5aIa/8Yh0qy3RXVmSI8TnvSXwCTN7wfYmib2/6 TIHpGKRiAiKKgw/pb5L8+vcp8M4Fqiy5BMUnxY6D7DHILB2Fvm+wmXT76TyO+qFfcBz+ reIiCXJOz4Qyq/O7ZPKgrut0Eefj8bSGOwCWuCRD1ghqf1M+UF99DL6IjuLb+tIiYkcf lc0Ryw5icAnX5f70BAXDOAtEf3Zt2owZNEwhq+frZ0HjIlt9e3Pt/4BIw6hVJD/GmPu1 DP8Q== 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=R6uHFraa2OSjPf2EcUleJpx/5BXtLzWBU5RXifaJ0Gg=; b=GmdCMb3hIwBxvMRUJqb5iQpyBpztvMM/4LOTP5L02Dg0tQn+nTQNWWUnXilGixVSl4 YVx8USY/1qEJfO6UYazt1zC+5zBGy9EbwewWb3P8h3auCkOeR53NrBP+5aAn8OtlNJxy V69l6/XWOPH9X/1XZOcXHizVxhW6mmBi0uFTW1waPOz9mIUcyzKjby5spIp+sA74BQcw y6as93NnpZUNGmdRmEBKPwaqZGknz1/FFzF1/COsCf8lIKRQcGg/KuW+pCR72Bx3PQua GlLmsOOdHHMyo3MkQQWmrUVP6lgslO3CJs/k020hweZiGD0yA3fdy/HpXNl9VJB06oaX TJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tM1EbFO1; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090a728800b00205daac38absi5274471pjg.59.2022.10.22.01.33.24; Sat, 22 Oct 2022 01:33:39 -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=tM1EbFO1; 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 S233626AbiJVIS6 (ORCPT + 99 others); Sat, 22 Oct 2022 04:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232976AbiJVIQ0 (ORCPT ); Sat, 22 Oct 2022 04:16:26 -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 A72E62DAC1B; Sat, 22 Oct 2022 00:57:20 -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 E2B8BB82E02; Sat, 22 Oct 2022 07:39:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 105E3C433C1; Sat, 22 Oct 2022 07:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424391; bh=6BEkaoCyr1a3B8J21YBWZZrVNR7enMef3nl7AAJ8oEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tM1EbFO1QJDqKj5aDywwCaP8Sn44XTQmjb5t0nxiJwbMaIdiNAjSTvKO7jSEttAQB zfBjCRPxhFfz7tk65cn5gwaMio4uK+l5LyNtzEQgoasJTq3fCDVcXW9FqLlm/f9D/2 PVzgqWrLA2if+pSpfcwFIVHqc0lJ/VZo+1zEDD5c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Lukas Czerner , Jan Kara , Jeff Layton , "Christian Brauner (Microsoft)" , Theodore Tso Subject: [PATCH 5.19 127/717] ext4: dont increase iversion counter for ea_inodes Date: Sat, 22 Oct 2022 09:20:06 +0200 Message-Id: <20221022072437.958359393@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376006940984086?= X-GMAIL-MSGID: =?utf-8?q?1747376006940984086?= From: Lukas Czerner commit 50f094a5580e6297bf10a807d16f0ee23fa576cf upstream. ea_inodes are using i_version for storing part of the reference count so we really need to leave it alone. The problem can be reproduced by xfstest ext4/026 when iversion is enabled. Fix it by not calling inode_inc_iversion() for EXT4_EA_INODE_FL inodes in ext4_mark_iloc_dirty(). Cc: stable@kernel.org Signed-off-by: Lukas Czerner Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Reviewed-by: Christian Brauner (Microsoft) Link: https://lore.kernel.org/r/20220824160349.39664-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5731,7 +5731,12 @@ int ext4_mark_iloc_dirty(handle_t *handl } ext4_fc_track_inode(handle, inode); - if (IS_I_VERSION(inode)) + /* + * ea_inodes are using i_version for storing reference count, don't + * mess with it + */ + if (IS_I_VERSION(inode) && + !(EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)) inode_inc_iversion(inode); /* the do_update_inode consumes one bh->b_count */