[SRU][J:linux-bluefield][PATCH 0/1] Bluefield 5.15.0-1084.86 build failure: nfsd4_get_drc_mem assertion with GCC 9
Satya Jhaveri
satya.jhaveri at canonical.com
Mon Feb 23 05:10:07 UTC 2026
From: sjhaveri <satya.jhaveri at canonical.com>
BugLink: https://bugs.launchpad.net/bugs/2142422
SRU Justification:
[ Impact ]
The Bluefield 5.15 kernel fails to build from source on GCC 9.
The Bluefield kernel has backported newer implementations in the `minmax.h`
header, which enforce strict compile-time checks on `clamp_t()`. However,
the legacy function `nfsd4_get_drc_mem()` in `fs/nfsd/nfs4state.c` code
contains logic where `max < min` is theoretically possible, causing the
compile-time assertions to fail.
This blocks the Bluefield 5.15 Kernel from successfully building in
environments with GCC 9 (such as Ubuntu Focal). Although GCC 9 is the
only version that fails to build with this issue, it is present
regardless, and future GCC versions may be capable of identifying this
issue as well.
[ Fix ]
Apply the backport of the upstream fix. Commit: "nfsd: Replace clamp_t
in nfsd4_get_drc_mem()"
As noted in the commit description, this patch was created specifically
for LTS Kernels to permit the application of the updated `minmax.h` header
without breaking the build, by replacing the clamp usage with open-coded
if-else logic to more safely and explicitly handle cases where `max < min`.
commit 5f4720ac8e67f41020cb39c678e4a3bdc26114fe
From: NeilBrown <neil at brown.name>
Date: Fri, 14 Nov 2025 16:19:22 -0500
Subject: nfsd: Replace clamp_t in nfsd4_get_drc_mem()
Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5f4720ac8e67
[ Test Plan ]
1. Setup a clean build environment with GCC 9 (for example, Focal)
2. Clone the `linux-bluefield` source.
3. Checkout the tag `Ubuntu-bluefield-5.15.0-1084.86`
4. Attempt to build the kernel.
5. Observe build failure at `fs/nfsd/nfs4state.c`.
6. Apply patch.
7. Attempt a clean build of the kernel.
8. Build succeeds.
[ Where problems could occur ]
The likelihood of problems occuring is very low. The upstream patch for this
issue was specifically created by upstream maintainers for this scenario. The
patch replaces the usage of the `clamp_t` macro with open-coded logic that
performs the same runtime operation, but avoids the compile-time assertion.
NeilBrown (1):
nfsd: Replace clamp_t in nfsd4_get_drc_mem()
fs/nfsd/nfs4state.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--
2.43.0
More information about the kernel-team
mailing list