All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: Christoph Hellwig <hch@lst.de>, linux-xfs@vger.kernel.org
Subject: [PATCH 2/2] xfs_db: add bigtime upgrade path
Date: Fri, 15 Jan 2021 17:25:08 -0800	[thread overview]
Message-ID: <161076030825.3386576.13001418188822105448.stgit@magnolia> (raw)
In-Reply-To: <161076029632.3386576.16317498856185564786.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

Enable users to upgrade their filesystems to bigtime support.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 db/sb.c              |   16 ++++++++++++++++
 man/man8/xfs_admin.8 |    5 +++++
 man/man8/xfs_db.8    |    4 ++++
 3 files changed, 25 insertions(+)


diff --git a/db/sb.c b/db/sb.c
index 767bc858..2ab07533 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -598,6 +598,7 @@ version_help(void)
 " 'version log2'     - enable v2 log format\n"
 " 'version needsrepair' - flag filesystem as requiring repair\n"
 " 'version inobtcount' - enable inode btree counters\n"
+" 'version bigtime'  - enable timestamps beyond year 2038\n"
 "\n"
 "The version function prints currently enabled features for a filesystem\n"
 "according to the version field of its primary superblock.\n"
@@ -874,6 +875,21 @@ version_f(
 			}
 
 			v5features.ro_compat |= XFS_SB_FEAT_RO_COMPAT_INOBTCNT;
+		} else if (!strcasecmp(argv[1], "bigtime")) {
+			if (xfs_sb_version_hasbigtime(&mp->m_sb)) {
+				dbprintf(
+		_("bigtime feature is already enabled\n"));
+				exitcode = 2;
+				return 1;
+			}
+			if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+				dbprintf(
+		_("bigtime feature cannot be enabled on pre-V5 filesystems\n"));
+				exitcode = 2;
+				return 1;
+			}
+
+			v5features.incompat |= XFS_SB_FEAT_INCOMPAT_BIGTIME;
 		} else if (!strcasecmp(argv[1], "extflg")) {
 			switch (XFS_SB_VERSION_NUM(&mp->m_sb)) {
 			case XFS_SB_VERSION_1:
diff --git a/man/man8/xfs_admin.8 b/man/man8/xfs_admin.8
index a776b375..a5ef9f84 100644
--- a/man/man8/xfs_admin.8
+++ b/man/man8/xfs_admin.8
@@ -123,6 +123,11 @@ This reduces mount time by caching the size of the inode btrees in the
 allocation group metadata.
 Once enabled, the filesystem will not be writable by older kernels.
 The filesystem cannot be downgraded after this feature is enabled.
+.TP
+.B bigtime
+Upgrade a V5 filesystem to support larger timestamps up to the year 2486.
+Once enabled, the filesystem will not be readable by older kernels.
+The filesystem cannot be downgraded.
 .RE
 .TP
 .BI \-U " uuid"
diff --git a/man/man8/xfs_db.8 b/man/man8/xfs_db.8
index 1b826e5d..cd2ace12 100644
--- a/man/man8/xfs_db.8
+++ b/man/man8/xfs_db.8
@@ -979,6 +979,10 @@ option is specified and the filesystem is formatted with the V5 format.
 Support for the inode btree counters feature can be enabled by using the
 .B inobtcount
 option if the filesystem is formatted with the V5 format.
+Support for timestamps between the years 2038 and 2486 can be enabled by
+using the
+.B bigtime
+option if the filesystem is formatted with the V5 format.
 .IP
 If no argument is given, the current version and feature bits are printed.
 With one argument, this command will write the updated version number


  parent reply	other threads:[~2021-01-16  1:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-16  1:24 [PATCHSET v3 0/2] xfs_admin: support upgrading v5 filesystems Darrick J. Wong
2021-01-16  1:25 ` [PATCH 1/2] xfs_db: add inobtcnt upgrade path Darrick J. Wong
2021-01-16  1:25 ` Darrick J. Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-02-03 19:43 [PATCHSET v4 0/2] xfs_admin: support upgrading v5 filesystems Darrick J. Wong
2021-02-03 19:43 ` [PATCH 2/2] xfs_db: add bigtime upgrade path Darrick J. Wong
2021-01-09  6:28 [PATCHSET v2 0/2] xfs_admin: support upgrading v5 filesystems Darrick J. Wong
2021-01-09  6:28 ` [PATCH 2/2] xfs_db: add bigtime upgrade path Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161076030825.3386576.13001418188822105448.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.