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 X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91CEDC433EF for ; Tue, 14 Sep 2021 02:40:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69C26610CC for ; Tue, 14 Sep 2021 02:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237812AbhINClo (ORCPT ); Mon, 13 Sep 2021 22:41:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237763AbhINClo (ORCPT ); Mon, 13 Sep 2021 22:41:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 98549610D1; Tue, 14 Sep 2021 02:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631587227; bh=X5ogbnVjcveGrsscnUsS9u6ZVa/diJ/mSITaysyn854=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XZQM0/g9Qv65wTaKF7CjQ0Zz8tD+4jqAwtt2uNdp/4chP6Ere0ZuTwaHIB//mcoad TXxpJDK9zrh/mOWx9OJtUUQHy/C/+CsOIhKEd3hptvdnRpD2t+K0paF7GECzzvPZo/ JRt2Eu/kHQmc2HB4HeEDeSWd5TOZfI+18fmWdO4p6zrq+YByWLAL3kIOusZdlLw+m/ ZkViwKO+CmMzJ97mbzaH+WMqymLI2KSXDR0kokDaTwgpIBf6ZVZW0YBoCDIl4+3CiA 6KcIqQTU+jgG0ozVOq97kwq89pBSSavJF4BzLahJxCLDMRGp/5X+kqZnGHdrI2hYP/ WSby5oc5ShwyA== Subject: [PATCH 05/43] xfs: allow setting and clearing of log incompat feature flags From: "Darrick J. Wong" To: sandeen@sandeen.net, djwong@kernel.org Cc: Allison Henderson , Chandan Babu R , linux-xfs@vger.kernel.org Date: Mon, 13 Sep 2021 19:40:27 -0700 Message-ID: <163158722735.1604118.6286172271568225071.stgit@magnolia> In-Reply-To: <163158719952.1604118.14415288328687941574.stgit@magnolia> References: <163158719952.1604118.14415288328687941574.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Source kernel commit: 908ce71e54f8265fa909200410d6c50ab9a2d302 Log incompat feature flags in the superblock exist for one purpose: to protect the contents of a dirty log from replay on a kernel that isn't prepared to handle those dirty contents. This means that they can be cleared if (a) we know the log is clean and (b) we know that there aren't any other threads in the system that might be setting or relying upon a log incompat flag. Therefore, clear the log incompat flags when we've finished recovering the log, when we're unmounting cleanly, remounting read-only, or freezing; and provide a function so that subsequent patches can start using this. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Chandan Babu R Signed-off-by: Darrick J. Wong --- libxfs/xfs_format.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index 37570cf0..5d8a1291 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -495,6 +495,21 @@ xfs_sb_has_incompat_log_feature( return (sbp->sb_features_log_incompat & feature) != 0; } +static inline void +xfs_sb_remove_incompat_log_features( + struct xfs_sb *sbp) +{ + sbp->sb_features_log_incompat &= ~XFS_SB_FEAT_INCOMPAT_LOG_ALL; +} + +static inline void +xfs_sb_add_incompat_log_features( + struct xfs_sb *sbp, + unsigned int features) +{ + sbp->sb_features_log_incompat |= features; +} + /* * V5 superblock specific feature checks */