Skip to content

Bugfix: Critical sysuser home directory creation failure with BTRFS_SUBVOLUME_HOME=yes on non-Btrfs paths#1609

Closed
silverhadch wants to merge 0 commit intoshadow-maint:masterfrom
silverhadch:master
Closed

Bugfix: Critical sysuser home directory creation failure with BTRFS_SUBVOLUME_HOME=yes on non-Btrfs paths#1609
silverhadch wants to merge 0 commit intoshadow-maint:masterfrom
silverhadch:master

Conversation

@silverhadch
Copy link
Copy Markdown
Contributor

@silverhadch silverhadch commented Apr 14, 2026

This fixes a critical bug. Previously, Btrfs subvolume creation was only applied on-demand, but now it's forced for all users whenever BTRFS_SUBVOLUME_HOME=yes is set. That logic is too aggressive: it causes system users with home directories in places like /var or /run to fail because those paths aren't Btrfs-backed. KDE Linux fails to boot with Btrfs home enabled because sysuser configurations require a home directory on tmpfs, yet the option forces a Btrfs subvolume even for those state directories. Without this patch, sysusers aren't created properly, as seen in this failing pipeline: https://invent.kde.org/kde-linux/kde-linux/-/pipelines/1215866. With the patch, the system falls back to a regular directory when a Btrfs home is requested by config or flag but the target path isn't Btrfs-backed, and it throws a warning to stderr. That allows sysusers on tmpfs or other non-Btrfs state directories to be created successfully, and the pipeline passes: https://invent.kde.org/kde-linux/kde-linux/-/pipelines/1216261. This resolves the boot failure, fixes Plasma login and setup, and generally prevents breakage for any sysuser with a home on a non-Btrfs filesystem with said option set.

@silverhadch
Copy link
Copy Markdown
Contributor Author

CC: @Conan-Kudo

@Conan-Kudo
Copy link
Copy Markdown
Contributor

The commit message needs to be reformatted so that it's 70 chars for the title and the rest of the information needs to be in the commit body (wrapped at 79 chars).

@silverhadch silverhadch force-pushed the master branch 2 times, most recently from 29f0d3f to f7ccf92 Compare April 14, 2026 10:13
@silverhadch silverhadch changed the title Handle BTRFS Home configuration without hard failure Bugfix: Handle BTRFS Home configuration without hard failure Apr 14, 2026
@silverhadch silverhadch changed the title Bugfix: Handle BTRFS Home configuration without hard failure Bugfix: Critical sysuser home directory creation failure with BTRFS_SUBVOLUME_HOME=yes on non-Btrfs paths Apr 15, 2026
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
@silverhadch silverhadch force-pushed the master branch 3 times, most recently from e5d68a8 to aaa34da Compare April 15, 2026 10:35
Comment thread src/useradd.c Outdated
Comment thread man/useradd.8.xml Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread man/useradd.8.xml Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
@silverhadch silverhadch force-pushed the master branch 2 times, most recently from 94f9613 to 67660a2 Compare April 20, 2026 16:16
@silverhadch silverhadch reopened this Apr 20, 2026
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread lib/btrfs.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
Comment thread src/useradd.c Outdated
@alejandro-colomar
Copy link
Copy Markdown
Collaborator

I've pushed a few changes to your branch, which resolve some issues. I've also significantly changed the design of the function. Now it's much simpler.

@alejandro-colomar
Copy link
Copy Markdown
Collaborator

alejandro-colomar commented Apr 22, 2026

Oops, I pushed by accident the contents of the master branch, and that has closed the PR. Would you mind reopening? You should get the commits from #1613.

@alejandro-colomar
Copy link
Copy Markdown
Collaborator

alejandro-colomar commented Apr 22, 2026

Oh, I can re-open myself. (No, it doesn't re-open; github is buggy.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants