All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 25/26] mkfs: format bigtime filesystems
Date: Mon, 26 Oct 2020 16:36:46 -0700	[thread overview]
Message-ID: <160375540688.881414.887151161169932986.stgit@magnolia> (raw)
In-Reply-To: <160375524618.881414.16347303401529121282.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Allow formatting with large timestamps.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 man/man8/mkfs.xfs.8 |   16 ++++++++++++++++
 mkfs/xfs_mkfs.c     |   24 +++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 1 deletion(-)


diff --git a/man/man8/mkfs.xfs.8 b/man/man8/mkfs.xfs.8
index 1a6a5f93f0ea..9e72a841f868 100644
--- a/man/man8/mkfs.xfs.8
+++ b/man/man8/mkfs.xfs.8
@@ -150,6 +150,22 @@ valid
 are:
 .RS 1.2i
 .TP
+.BI bigtime= value
+This option enables filesystems that can handle inode timestamps from December
+1901 to July 2486, and quota timer expirations from January 1970 to July 2486.
+The value is either 0 to disable the feature, or 1 to enable large timestamps.
+.IP
+If this feature is not enabled, the filesystem can only handle timestamps from
+December 1901 to January 2038, and quota timers from January 1970 to February
+2106.
+.IP
+By default,
+.B mkfs.xfs
+will not enable this feature.
+If the option
+.B \-m crc=0
+is used, the large timestamp feature is not supported and is disabled.
+.TP
 .BI crc= value
 This is used to create a filesystem which maintains and checks CRC information
 in all metadata objects on disk. The value is either 0 to disable the feature,
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 23e3077e0174..4cb79b695921 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -120,6 +120,7 @@ enum {
 	M_RMAPBT,
 	M_REFLINK,
 	M_INOBTCNT,
+	M_BIGTIME,
 	M_MAX_OPTS,
 };
 
@@ -662,6 +663,7 @@ static struct opt_params mopts = {
 		[M_RMAPBT] = "rmapbt",
 		[M_REFLINK] = "reflink",
 		[M_INOBTCNT] = "inobtcount",
+		[M_BIGTIME] = "bigtime",
 	},
 	.subopt_params = {
 		{ .index = M_CRC,
@@ -698,6 +700,12 @@ static struct opt_params mopts = {
 		  .maxval = 1,
 		  .defaultval = 1,
 		},
+		{ .index = M_BIGTIME,
+		  .conflicts = { { NULL, LAST_CONFLICT } },
+		  .minval = 0,
+		  .maxval = 1,
+		  .defaultval = 1,
+		},
 	},
 };
 
@@ -749,6 +757,7 @@ struct sb_feat_args {
 	bool	rmapbt;			/* XFS_SB_FEAT_RO_COMPAT_RMAPBT */
 	bool	reflink;		/* XFS_SB_FEAT_RO_COMPAT_REFLINK */
 	bool	inobtcnt;		/* XFS_SB_FEAT_RO_COMPAT_INOBTCNT */
+	bool	bigtime;		/* XFS_SB_FEAT_INCOMPAT_BIGTIME */
 	bool	nodalign;
 	bool	nortalign;
 };
@@ -872,7 +881,7 @@ usage( void )
 	fprintf(stderr, _("Usage: %s\n\
 /* blocksize */		[-b size=num]\n\
 /* metadata */		[-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,\n\
-			    inobtcnt=0|1]\n\
+			    inobtcnt=0|1,bigtime=0|1]\n\
 /* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,\n\
 			    (sunit=value,swidth=value|su=num,sw=num|noalign),\n\
 			    sectsize=num\n\
@@ -1578,6 +1587,9 @@ meta_opts_parser(
 	case M_INOBTCNT:
 		cli->sb_feat.inobtcnt = getnum(value, opts, subopt);
 		break;
+	case M_BIGTIME:
+		cli->sb_feat.bigtime = getnum(value, opts, subopt);
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -2008,6 +2020,13 @@ _("inode btree counters not supported without CRC support\n"));
 			usage();
 		}
 		cli->sb_feat.inobtcnt = false;
+
+		if (cli->sb_feat.bigtime && cli_opt_set(&mopts, M_BIGTIME)) {
+			fprintf(stderr,
+_("timestamps later than 2038 not supported without CRC support\n"));
+			usage();
+		}
+		cli->sb_feat.bigtime = false;
 	}
 
 	if (!cli->sb_feat.finobt) {
@@ -2986,6 +3005,8 @@ sb_set_features(
 		sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_REFLINK;
 	if (fp->inobtcnt)
 		sbp->sb_features_ro_compat |= XFS_SB_FEAT_RO_COMPAT_INOBTCNT;
+	if (fp->bigtime)
+		sbp->sb_features_incompat |= XFS_SB_FEAT_INCOMPAT_BIGTIME;
 
 	/*
 	 * Sparse inode chunk support has two main inode alignment requirements.
@@ -3652,6 +3673,7 @@ main(
 			.parent_pointers = false,
 			.nodalign = false,
 			.nortalign = false,
+			.bigtime = false,
 		},
 	};
 


  parent reply	other threads:[~2020-10-26 23:36 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 23:34 [PATCH v6 00/26] xfsprogs: widen timestamps to deal with y2038 Darrick J. Wong
2020-10-26 23:34 ` [PATCH 01/26] libxfs: create a real struct timespec64 Darrick J. Wong
2020-10-29  9:44   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 02/26] libxfs: refactor NSEC_PER_SEC Darrick J. Wong
2020-10-29  9:44   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 03/26] libfrog: define LIBFROG_BULKSTAT_CHUNKSIZE to remove dependence on XFS_INODES_PER_CHUNK Darrick J. Wong
2020-10-29  9:45   ` Christoph Hellwig
2020-10-29  9:45     ` Christoph Hellwig
2020-10-29 17:25       ` Darrick J. Wong
2020-10-30  8:20         ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 04/26] libfrog: convert cvttime to return time64_t Darrick J. Wong
2020-10-29  9:45   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 05/26] xfs_quota: convert time_to_string to use time64_t Darrick J. Wong
2020-10-29  9:47   ` Christoph Hellwig
2020-10-29 17:32     ` Darrick J. Wong
2020-10-30  8:21       ` Christoph Hellwig
2020-11-16 20:45   ` Eric Sandeen
2020-10-26 23:34 ` [PATCH 06/26] xfs_db: refactor timestamp printing Darrick J. Wong
2020-10-29  9:47   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 07/26] xfs_db: refactor quota timer printing Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-10-26 23:34 ` [PATCH 08/26] xfs_logprint: refactor timestamp printing Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-11-23 20:14   ` Eric Sandeen
2020-11-24  0:25     ` Darrick J. Wong
2020-10-26 23:35 ` [PATCH 09/26] xfs: explicitly define inode timestamp range Darrick J. Wong
2020-10-26 23:35 ` [PATCH 10/26] xfs: refactor quota expiration timer modification Darrick J. Wong
2020-10-26 23:35 ` [PATCH 11/26] xfs: refactor default quota grace period setting code Darrick J. Wong
2020-10-26 23:35 ` [PATCH 12/26] xfs: refactor quota timestamp coding Darrick J. Wong
2020-10-26 23:35 ` [PATCH 13/26] xfs: move xfs_log_dinode_to_disk to the log recovery code Darrick J. Wong
2020-10-26 23:35 ` [PATCH 14/26] xfs: redefine xfs_timestamp_t Darrick J. Wong
2020-10-26 23:35 ` [PATCH 15/26] xfs: redefine xfs_ictimestamp_t Darrick J. Wong
2020-10-26 23:35 ` [PATCH 16/26] xfs: widen ondisk inode timestamps to deal with y2038+ Darrick J. Wong
2020-10-26 23:35 ` [PATCH 17/26] xfs: widen ondisk quota expiration timestamps to handle y2038+ Darrick J. Wong
2020-10-26 23:36 ` [PATCH 18/26] libxfs: propagate bigtime inode flag when allocating Darrick J. Wong
2020-10-29  9:48   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 19/26] libfrog: list the bigtime feature when reporting geometry Darrick J. Wong
2020-10-29  9:49   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 20/26] xfs_db: report bigtime format timestamps Darrick J. Wong
2020-10-29  9:50   ` Christoph Hellwig
2020-10-29 17:45     ` Darrick J. Wong
2020-10-30  8:23       ` Christoph Hellwig
2020-11-16 21:16   ` Eric Sandeen
2020-11-16 22:41     ` Darrick J. Wong
2020-11-17 17:45   ` [PATCH v2 " Darrick J. Wong
2020-11-17 18:18     ` Eric Sandeen
2020-10-26 23:36 ` [PATCH 21/26] xfs_db: support printing time limits Darrick J. Wong
2020-10-29  9:50   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 22/26] xfs_db: add bigtime upgrade path Darrick J. Wong
2020-10-29  9:51   ` Christoph Hellwig
2020-11-16 21:15   ` [PATCH v2 " Darrick J. Wong
2020-10-26 23:36 ` [PATCH 23/26] xfs_quota: support editing and reporting quotas with bigtime Darrick J. Wong
2020-10-29  9:51   ` Christoph Hellwig
2020-10-26 23:36 ` [PATCH 24/26] xfs_repair: support bigtime timestamp checking Darrick J. Wong
2020-10-29  9:52   ` Christoph Hellwig
2020-10-26 23:36 ` Darrick J. Wong [this message]
2020-10-29  9:52   ` [PATCH 25/26] mkfs: format bigtime filesystems Christoph Hellwig
2020-10-26 23:36 ` [PATCH 26/26] xfs: enable big timestamps 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=160375540688.881414.887151161169932986.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --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.