Skip to content

useradd: skip btrfs subvolume creation for system users#1619

Open
silverhadch wants to merge 1 commit intoshadow-maint:masterfrom
silverhadch:work/hadi/uid-guard-btrfs
Open

useradd: skip btrfs subvolume creation for system users#1619
silverhadch wants to merge 1 commit intoshadow-maint:masterfrom
silverhadch:work/hadi/uid-guard-btrfs

Conversation

@silverhadch
Copy link
Copy Markdown
Contributor

Gate subvolume creation on user_id >= UID_MIN to exclude system users regardless of their home path.

Fixes: c1d36a8 (2019-05-04; "Add support for btrfs subvolumes for user homes")

@alejandro-colomar
Copy link
Copy Markdown
Collaborator

The code seems good to me.

Do we need to document that BTRFS configuration is ignored for system users?

Also, I think the commit message should document why we don't want BTRFS subvolumes for system users.

@silverhadch
Copy link
Copy Markdown
Contributor Author

The code seems good to me.

Do we need to document that BTRFS configuration is ignored for system users?

Also, I think the commit message should document why we don't want BTRFS subvolumes for system users.

Subvolumes for non intercative users are wasteful as they multiply metadata operations and generate unneccesary filesystem objects for operations, a system user who doesnt generate snapshot worthy data, wont use.

But I dont think its worth documenting as this is simply sane design. This BTRFS Backend never mattered to system users as the BTRFS Backend orginally released only supported interactive subvol creation. There is no usage for subvols (aka wasting metadata) for system users with state home dirs.

@alejandro-colomar
Copy link
Copy Markdown
Collaborator

alejandro-colomar commented Apr 28, 2026

The code seems good to me.
Do we need to document that BTRFS configuration is ignored for system users?
Also, I think the commit message should document why we don't want BTRFS subvolumes for system users.

Subvolumes for non intercative users are wasteful as they multiply metadata operations and generate unneccesary filesystem objects for operations, a system user who doesnt generate snapshot worthy data, wont use.

Please copy this into the commit message.

But I dont think its worth documenting as this is simply sane design. This BTRFS Backend never mattered to system users as the BTRFS Backend orginally released only supported interactive subvol creation. There is no usage for subvols (aka wasting metadata) for system users with state home dirs.

This is still useful information for someone like me that has never used BTRFS and doesn't know anything about it other than the fact that it's a file system. :)

I'd like to have it at least in the commit message. I don't care too much about the manual page.

@silverhadch silverhadch force-pushed the work/hadi/uid-guard-btrfs branch from efd0339 to f9906f3 Compare April 29, 2026 12:08
@silverhadch
Copy link
Copy Markdown
Contributor Author

The code seems good to me.
Do we need to document that BTRFS configuration is ignored for system users?
Also, I think the commit message should document why we don't want BTRFS subvolumes for system users.

Subvolumes for non intercative users are wasteful as they multiply metadata operations and generate unneccesary filesystem objects for operations, a system user who doesnt generate snapshot worthy data, wont use.

Please copy this into the commit message.

But I dont think its worth documenting as this is simply sane design. This BTRFS Backend never mattered to system users as the BTRFS Backend orginally released only supported interactive subvol creation. There is no usage for subvols (aka wasting metadata) for system users with state home dirs.

This is still useful information for someone like me that has never used BTRFS and doesn't know anything about it other than the fact that it's a file system. :)

I'd like to have it at least in the commit message. I don't care too much about the manual page.

Done. Documented in the commit message.

Gate subvolume creation on user_id >= UID_MIN to exclude system users
regardless of their home path.

System users do not benefit from BTRFS subvolumes. They hold no
snapshot-worthy data and do not interact with the filesystem in ways
that would justify the overhead. Subvolumes multiply metadata operations
and create unnecessary filesystem objects for accounts that simply do
not need them. The BTRFS backend originally required an explicit flag to
opt in to subvolume creation, making interactive useradd invocations the
only practical target. Skipping subvolume creation for system users is
the appropriate default.

Fixes: c1d36a8 (2019-05-04; "Add support for btrfs subvolumes for user homes")
Signed-off-by: Hadi Chokr <hadichokr@icloud.com>
@silverhadch silverhadch force-pushed the work/hadi/uid-guard-btrfs branch from f9906f3 to 2176bd2 Compare April 29, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants