diff --git a/xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch b/xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch new file mode 100644 index 0000000000000000000000000000000000000000..f5643fa4a57cf7bb56b47c1a138ce13dbd72e1af --- /dev/null +++ b/xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch @@ -0,0 +1,85 @@ +--- xfsprogs-5.12.0.orig/man/man8/mkfs.xfs.8 ++++ xfsprogs-5.12.0/man/man8/mkfs.xfs.8 +@@ -203,7 +203,7 @@ December 1901 to January 2038, and quota + .IP + By default, + .B mkfs.xfs +-will not enable this feature. ++in openeuler will enable this feature. + If the option + .B \-m crc=0 + is used, the large timestamp feature is not supported and is disabled. +@@ -256,7 +256,7 @@ This can be used to reduce mount times w + .IP + By default, + .B mkfs.xfs +-will not enable this option. ++in openeuler will enable this option. + This feature is only available for filesystems created with the (default) + .B \-m finobt=1 + option set. +--- xfsprogs-5.12.0.orig/mkfs/xfs_mkfs.c ++++ xfsprogs-5.12.0/mkfs/xfs_mkfs.c +@@ -3795,6 +3797,23 @@ cfgfile_parse( + cli->cfgfile); + } + ++static unsigned int get_system_kver(void) ++{ ++ const char *kver = getenv("KVER"); ++ struct utsname utsname; ++ int a, b, c; ++ ++ if (!kver) { ++ uname(&utsname); ++ kver = utsname.release; ++ } ++ ++ if (sscanf(kver, "%d.%d.%d", &a, &b, &c) != 3) ++ return LINUX_VERSION_CODE; ++ ++ return KERNEL_VERSION(a,b,c); ++} ++ + int + main( + int argc, +@@ -3848,17 +3867,25 @@ main( + .spinodes = true, + .rmapbt = false, + .reflink = true, +- .inobtcnt = false, ++ .inobtcnt = true, + .parent_pointers = false, + .nodalign = false, + .nortalign = false, +- .bigtime = false, ++ .bigtime = true, + }, + }; + + struct list_head buffer_list; ++ unsigned int kver; + int error; + ++ /* turn bigtime & inobtcnt back off if running under older kernels */ ++ kver = get_system_kver(); ++ if (kver < KERNEL_VERSION(5,10,0)) { ++ dft.sb_feat.inobtcnt = false; ++ dft.sb_feat.bigtime = false; ++ } ++ + platform_uuid_generate(&cli.uuid); + progname = basename(argv[0]); + setlocale(LC_ALL, ""); +--- xfsprogs-5.14.0/mkfs/xfs_mkfs.c.orig ++++ xfsprogs-5.14.0/mkfs/xfs_mkfs.c +@@ -12,6 +12,8 @@ + #include "libfrog/convert.h" + #include "proto.h" + #include ++#include ++#include + + #define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog))) + #define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog))) diff --git a/xfsprogs.spec b/xfsprogs.spec index 1420aa916dfe80d60a4503d724e1ce38ef6ebc93..44c4868b23097bd7510538793f8f6a8a82ac9230 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 5.14.1 -Release: 1 +Release: 2 Summary: Administration and debugging tools for the XFS file system License: GPL+ and LGPLv2+ URL: https://xfs.wiki.kernel.org @@ -17,6 +17,8 @@ Provides: xfsprogs-qa-devel Obsoletes: xfsprogs-qa-devel <= %{version} Conflicts: xfsdump < 3.0.1 +Patch0: xfsprogs-5.12.0-default-bigtime-inobtcnt-on.patch + %description xfsprogs are the userspace utilities that manage XFS filesystems. @@ -99,6 +101,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %changelog +* Fri Jun 10 2022 xiongyu - 5.14.1-2 +- turn bigtime & inobtcnt on as default + * Mon Dec 6 2021 yanglongkang - 5.14.1-1 - update package to 5.14.1