Lustre Kernel Patching Details
Lustre requires kernel patches primarily for server components to integrate deeply with the Linux filesystem and block layers (e.g., for LDISKFS OSD, quotas, security features like Kerberos/GSS). Clients can often use unpatched kernels with prebuilt modules. This information is based on the latest Lustre wiki and manual as of January 2026 (Lustre 2.17.0). For upstreaming progress, which aims to reduce patching, see below. Always refer to official wiki for updates.
Why Kernel Patching May Be Needed
- Server-Side Requirements: Patches enable features like project quotas on older kernels (<4.5 for ldiskfs, <0.8 for ZFS), larger RPC sizes, Kerberos/GSS security, client-side encryption (fscrypt in 2.14+), and recovery mechanisms (e.g., VBR, LFSCK).
- Client vs. Server: Servers need a fully patched kernel for OSD and backend integration. Clients use DKMS or modules on vanilla kernels unless serving dual roles.
- Upstreaming Efforts: Ongoing work to integrate Lustre into mainline Linux (targeting fs/lustre/, net/lnet/) to minimize out-of-tree patches. As of June 2025, code separation is in progress; full upstream submission planned post-2026.
- Patches address compatibility with vendor kernels (RHEL, SLES) and fix bugs (e.g., RAID-5 issues, ext4 prealloc in recent JIRA LU-19758).
Kernel Patch Directory Layout and Management
- Patches: Stored in
lustre/kernel_patches/patches/(e.g.,jbd2-revoke-rhashtable-rhel8.4.patch). - Series Files: In
lustre/kernel_patches/series/(e.g.,5.14-rhel9.7.series) -lists patch order. - Targets: In
lustre/kernel_patches/targets/– defines kernel versions, arches, series (e.g.,5.14-rhel9.7.target.in). - Configs: In
lustre/kernel_patches/kernel_configs/– predefined.configfiles.
Use Quilt for management: Install via package manager. Configure ~/.quiltrc with QUILT_DIFF_OPTS="-upa" and QUILT_NO_DIFF_TIMESTAMPS=1.
Patching Process
Patch during source build. Prerequisites: Download Lustre source, unpatched kernel (from Whamcloud), e2fsprogs, Quilt.
# Unpack sources (example for Lustre 2.17.0, kernel 5.14 for RHEL9 clone)
tar -xf lustre-2.17.0.tar.gz
tar -xf linux-5.14.tar.xz # Adjust kernel version per distro
# Setup symlinks in kernel tree (e.g., 5.14-el9.series)
cd linux-5.14
ln -s ../lustre-2.17.0/lustre/kernel_patches/series/SERIES-FILE.series series
ln -s ../lustre-2.17.0/lustre/kernel_patches/patches patches
# Apply patches with Quilt
quilt push -av
# Configure and build kernel (e.g., kernel-5.14-el9-x86_64.config)
cp ../lustre-2.17.0/lustre/kernel_patches/kernel_configs/<config-file> .config
make oldconfig
make bzImage
make modules
make modules_install
make install # Or build RPMs: make rpm
# Build Lustre (client/server)
cd ../lustre-2.17.0
./configure --with-linux=../linux-5.14 --enable-server # For server; omit for client-only
make
make install
# Reboot into patched kernel
For client-only: Use --disable-server in configure. Install e2fsprogs separately for servers.
Maintaining and Fixing Patches
- Naming: PATCHNAME-KERNEL-VERSION.patch.
- Adding Patch: quilt new PATCHNAME, edit, quilt refresh.
- Fixing Bug: Pop patch (quilt pop PATCHNAME), fix file, refresh, test with acceptance-small suite.
- Upgrading Kernel: Fork patch (quilt fork <new-name>), resolve conflicts, refresh.
- Recent JIRA: LU-19649 (ext4-pdirop error handling, Dec 2025), LU-19494 (RHEL8.10 security fixes), LU-18809 (SLES15 SP6 updates).
Upstreaming and Future
Upstreaming separates core code (fs/lustre/, net/lnet/) from compatibility layers. In progress: IPv6, kernel-doc, rhashtable, folios. Goal: Mainline as source of truth by 2026+, reducing vendor-specific patches. Submit via Gerrit, backport to older kernels.
For troubleshooting, see Lustre Manual (updated Aug 2025) or JIRA.