-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: changed the default value of nrext64 to 0 to avoid unstable feature of nrext64 #295
base: develop
Are you sure you want to change the base?
Changes from all commits
5a85369
6c55d99
e00a34e
abbc6cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ Source100: config-bottlerocket | |
Source220: neuron-sysinit.target.drop-in.conf | ||
Source221: [email protected] | ||
|
||
# XFS configuration | ||
Source300: mkfs.xfs.conf | ||
|
||
# Help out-of-tree module builds run `make prepare` automatically. | ||
Patch1001: 1001-Makefile-add-prepare-target-for-external-modules.patch | ||
# Enable INITRAMFS_FORCE config option for our use case. | ||
|
@@ -83,6 +86,12 @@ Summary: Modules for the Linux kernel | |
%description modules | ||
%{summary}. | ||
|
||
%package mkfs-confs | ||
Summary: mkfs configurations for different file systems | ||
|
||
%description mkfs-confs | ||
%{summary}. | ||
|
||
%if "%{_cross_arch}" == "x86_64" | ||
%package modules-neuron | ||
Summary: Modules for the Linux kernel with Neuron hardware | ||
|
@@ -291,6 +300,9 @@ mkdir -p %{buildroot}%{_cross_unitdir}/[email protected] | |
install -p -m 0644 %{S:221} %{buildroot}%{_cross_unitdir}/[email protected]/neuron.conf | ||
%endif | ||
|
||
mkdir -p %{buildroot}%{_cross_datadir}/xfs | ||
install -p -m 0644 %{S:300} %{buildroot}%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
%files | ||
%license COPYING LICENSES/preferred/GPL-2.0 LICENSES/exceptions/Linux-syscall-note | ||
%{_cross_attribution_file} | ||
|
@@ -340,4 +352,7 @@ install -p -m 0644 %{S:221} %{buildroot}%{_cross_unitdir}/[email protected] | |
%files archive | ||
%{_cross_datadir}/bottlerocket/kernel-devel.tar.xz | ||
|
||
%files mkfs-confs | ||
%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
%changelog |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# V5 features that were the mkfs defaults when the upstream Linux 5.10 LTS | ||
# kernel was released at the end of 2020. | ||
|
||
[inode] | ||
nrext64=0 | ||
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really the only feature of interest that's worth pinning? It seems a bit sparse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, this is indeed the only feature we care about to fix the original issue. Unless you have more thoughts and we can sure add more in other PRs -- I still think we should only keep this one here because this is the one related to the issue. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ Source100: config-bottlerocket | |
Source220: neuron-sysinit.target.drop-in.conf | ||
Source221: [email protected] | ||
|
||
# XFS configuration | ||
Source300: mkfs.xfs.conf | ||
|
||
# Help out-of-tree module builds run `make prepare` automatically. | ||
Patch1001: 1001-Makefile-add-prepare-target-for-external-modules.patch | ||
# Expose tools/* targets for out-of-tree module builds. | ||
|
@@ -81,6 +84,12 @@ Summary: Modules for the Linux kernel | |
%description modules | ||
%{summary}. | ||
|
||
%package mkfs-confs | ||
Summary: mkfs configurations for different file systems | ||
|
||
%description mkfs-confs | ||
%{summary}. | ||
|
||
%if "%{_cross_arch}" == "x86_64" | ||
%package modules-neuron | ||
Summary: Modules for the Linux kernel with Neuron hardware | ||
|
@@ -285,6 +294,9 @@ mkdir -p %{buildroot}%{_cross_unitdir}/[email protected] | |
install -p -m 0644 %{S:221} %{buildroot}%{_cross_unitdir}/[email protected]/neuron.conf | ||
%endif | ||
|
||
mkdir -p %{buildroot}%{_cross_datadir}/xfs | ||
install -p -m 0644 %{S:300} %{buildroot}%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
%files | ||
%license COPYING LICENSES/preferred/GPL-2.0 LICENSES/exceptions/Linux-syscall-note | ||
%{_cross_attribution_file} | ||
|
@@ -334,4 +346,7 @@ install -p -m 0644 %{S:221} %{buildroot}%{_cross_unitdir}/[email protected] | |
%files archive | ||
%{_cross_datadir}/bottlerocket/kernel-devel.tar.xz | ||
|
||
%files mkfs-confs | ||
%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
%changelog |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# V5 features that were the mkfs defaults when the upstream Linux 5.15 LTS | ||
# kernel was released at the end of 2021. | ||
|
||
[inode] | ||
nrext64=0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,9 @@ Source300: bootconfig-aws.conf | |
Source301: bootconfig-vmware.conf | ||
Source302: bootconfig-metal.conf | ||
|
||
# XFS configuration | ||
Source400: mkfs.xfs.conf | ||
|
||
# Help out-of-tree module builds run `make prepare` automatically. | ||
Patch1001: 1001-Makefile-add-prepare-target-for-external-modules.patch | ||
# Expose tools/* targets for out-of-tree module builds. | ||
|
@@ -138,6 +141,12 @@ Summary: Modules for the Linux kernel on bare metal | |
%description modules-metal | ||
%{summary}. | ||
|
||
%package mkfs-confs | ||
Summary: mkfs configurations for different file systems | ||
|
||
%description mkfs-confs | ||
%{summary}. | ||
|
||
%if "%{_cross_arch}" == "x86_64" | ||
%package modules-neuron | ||
Summary: Modules for the Linux kernel with Neuron hardware | ||
|
@@ -377,6 +386,9 @@ mkdir -p %{buildroot}%{_cross_unitdir}/[email protected] | |
install -p -m 0644 %{S:221} %{buildroot}%{_cross_unitdir}/[email protected]/neuron.conf | ||
%endif | ||
|
||
mkdir -p %{buildroot}%{_cross_datadir}/xfs | ||
install -p -m 0644 %{S:400} %{buildroot}%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
# Install platform-specific bootconfig snippets. | ||
install -d %{buildroot}%{_cross_bootconfigdir} | ||
install -p -m 0644 %{S:300} %{buildroot}%{_cross_bootconfigdir}/05-aws.conf | ||
|
@@ -1431,4 +1443,7 @@ install -p -m 0644 %{S:302} %{buildroot}%{_cross_bootconfigdir}/05-metal.conf | |
%{_cross_unitdir}/[email protected]/neuron.conf | ||
%endif | ||
|
||
%files mkfs-confs | ||
%{_cross_datadir}/xfs/mkfs.xfs.conf | ||
|
||
%changelog |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# V5 features that were the mkfs defaults when the upstream Linux 6.1 LTS | ||
# kernel was released at the end of 2022. | ||
|
||
[inode] | ||
nrext64=0 | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we keep this as the default of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is. But it will show |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
From b20a9a213e1f4901072f559e3aef4797b5955c59 Mon Sep 17 00:00:00 2001 | ||
From: Sparks Song <[email protected]> | ||
Date: Wed, 4 Dec 2024 23:47:28 +0000 | ||
Subject: [PATCH] mkfs: source defaults from config file to make nrext64 | ||
default off on multiple kernel versions | ||
|
||
--- | ||
mkfs/xfs_mkfs.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- | ||
1 file changed, 50 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c | ||
index 6d2469c..1f6f643 100644 | ||
--- a/mkfs/xfs_mkfs.c | ||
+++ b/mkfs/xfs_mkfs.c | ||
@@ -39,6 +39,9 @@ | ||
*/ | ||
#define WHACK_SIZE (128 * 1024) | ||
|
||
+/* Default path for the mkfs.xfs configuration file */ | ||
+#define DEFAULT_CONFIG_PATH "/usr/share/xfs/mkfs.xfs.conf" | ||
+ | ||
/* | ||
* XXX: The configured block and sector sizes are defined as global variables so | ||
* that they don't need to be passed to getnum/cvtnum(). | ||
@@ -4271,6 +4274,44 @@ cfgfile_parse( | ||
cli->cfgfile); | ||
} | ||
|
||
+ | ||
+/* This function is similar to cfgfile_parse() and specifically parses | ||
+ * default config files. It doesn’t exit on failure. | ||
+ */ | ||
Comment on lines
+29
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function seems almost identical to Rather than duplicate the function, I would just leave the message unmodified (it will obviously point to the default config file) and add a check around
The problem with the copy-paste-tweak approach to patching is that if the upstream version of the function ever changes, your copy-paste version won't pick up those changes, and the patch is very likely to still apply cleanly. By modifying the existing function in a careful way, you are much more likely to see the patch fail to apply on newer versions if there's been a significant change, which is what you want as it will signal the need to revisit the downstream alteration. |
||
+static void | ||
+cfgfile_parse_default( | ||
+ struct cli_params *cli) | ||
+{ | ||
+ int error; | ||
+ | ||
+ if (!cli->cfgfile) | ||
+ return; | ||
+ | ||
+ error = ini_parse(cli->cfgfile, cfgfile_parse_ini, cli); | ||
+ if (error) { | ||
+ if (error > 0) { | ||
+ fprintf(stderr, | ||
+ _("%s: Unrecognised input on line %d. Aborting.\n"), | ||
+ cli->cfgfile, error); | ||
+ } else if (error == -1) { | ||
+ fprintf(stderr, | ||
+ _("Unable to open default config file %s. Aborting.\n"), | ||
+ cli->cfgfile); | ||
+ } else if (error == -2) { | ||
+ fprintf(stderr, | ||
+ _("Memory allocation failure parsing %s. Aborting.\n"), | ||
+ cli->cfgfile); | ||
+ } else { | ||
+ fprintf(stderr, | ||
+ _("Unknown error %d opening default config file %s. Aborting.\n"), | ||
+ error, cli->cfgfile); | ||
+ } | ||
+ } else { | ||
+ printf(_("Parameters parsed from default config file %s successfully\n"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see this output in the journal when it ran successfully? Do we expect this to be seen on every boot or are the mkfs.xfs calls for the XFS backed data partitions not emitting logs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comment 1: I did make confirmation on
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so it sounds like you did validate that this code fixes the issue in bottlerocket-os/bottlerocket#4281 but just on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I did both 1.24 and 1.25 tests, both works. |
||
+ cli->cfgfile); | ||
+ } | ||
+} | ||
+ | ||
int | ||
main( | ||
int argc, | ||
@@ -4428,7 +4469,15 @@ main( | ||
* the options from this file parsed, we can then proceed with parameter | ||
* and bounds checking and making the filesystem. | ||
*/ | ||
- cfgfile_parse(&cli); | ||
+ | ||
+ if (cli.cfgfile == NULL) { | ||
+ /* No user config file specified, try default config */ | ||
+ cli.cfgfile = DEFAULT_CONFIG_PATH; | ||
+ cfgfile_parse_default(&cli); | ||
+ } else { | ||
+ /* User specified their own config file, use that */ | ||
+ cfgfile_parse(&cli); | ||
+ } | ||
Comment on lines
+74
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should all just be:
That minimizes the changes to this function while still providing the fallback behavior you're trying to add. |
||
|
||
protostring = setup_proto(cli.protofile); | ||
|
||
-- | ||
2.47.0 | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,6 +6,8 @@ License: GPL-2.0-only AND LGPL-2.1-only | |||||||||
URL: https://xfs.wiki.kernel.org | ||||||||||
Source0: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.xz | ||||||||||
|
||||||||||
Patch1000: 0001-mkfs-source-defaults-from-config-file.patch | ||||||||||
|
||||||||||
BuildRequires: %{_cross_os}glibc-devel | ||||||||||
BuildRequires: %{_cross_os}libuuid-devel | ||||||||||
BuildRequires: %{_cross_os}libinih-devel | ||||||||||
|
@@ -14,6 +16,9 @@ BuildRequires: %{_cross_os}libblkid-devel | |||||||||
|
||||||||||
Requires: %{_cross_os}liburcu | ||||||||||
Requires: %{_cross_os}libinih | ||||||||||
Requires: (%{_cross_os}kernel-5.10-mkfs-confs if %{_cross_os}kernel-5.10) | ||||||||||
Requires: (%{_cross_os}kernel-5.15-mkfs-confs if %{_cross_os}kernel-5.15) | ||||||||||
Requires: (%{_cross_os}kernel-6.1-mkfs-confs if %{_cross_os}kernel-6.1) | ||||||||||
Comment on lines
+19
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please just require a generic capability that any kernel package can implement. Otherwise it will be challenging to bring a custom kernel of a different version.
Suggested change
|
||||||||||
|
||||||||||
%description | ||||||||||
%{summary}. | ||||||||||
|
@@ -26,7 +31,7 @@ Requires: %{name} | |||||||||
%{summary}. | ||||||||||
|
||||||||||
%prep | ||||||||||
%autosetup -n xfsprogs-%{version} | ||||||||||
%autosetup -n xfsprogs-%{version} -p1 | ||||||||||
|
||||||||||
%build | ||||||||||
%cross_configure \ | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions to improve the dependencies:
Goal is to make it so that only one
mkfs-confs
package can be installed.However, that said - I would not make this a separate subpackage, but instead add that
Provides
andConflicts
to the parent kernel package.