switch-root: do not check fs to sync against allowlist

This drops a good chunk of 21ab2fe6ec
again, which I think is plainly wrong or at the very least too
overengineered.

1. it's wrong to assume that overlayfs layers are mounted elsewhere in
   the fs. it's quite likely they aren't. and overlayfs correctly passes
   through fsync() to the top layer, hence we really should keep syncing
   it.

2. network file systems deserve syncing. This code here runs in the
   initrd, where a very restrictive set of file systems is mounted and
   which runs for a very short time only, i.e. the circumstances haven't
   really changed. Hence I am very sure it's better to sync file systems
   here than not to, we do this for safety reasons after all.
   Reliability always trumps speed here, we should not give up
   correctness over presumed speed improvements.

3. There's zero reason to believe FUSE doesn't need syncing. We live in
   a world where increasingly complex kernel file systems are moved to
   userspace, and hence FUSE can be used to implement *anything*. Hence
   we should sync it. Yes, FUSE means some backing process needs to run,
   but that's a job for the initrd to get right: make sure the process
   runs properly over the switch root if the mount is left in tact over
   the switch root too.

Hence, dumb this all down and drop the weird fine tuning here.
This commit is contained in:
Lennart Poettering
2026-08-24 14:06:59 +02:00
committed by Lennart Poettering
parent d669464b2a
commit 9139f3c53f
3 changed files with 6 additions and 85 deletions
-8
View File
@@ -424,14 +424,6 @@ bool fstype_is_blockdev_backed(const char *fstype) {
return !STR_IN_SET(fstype, "9p", "overlay") && !fstype_is_network(fstype) && !fstype_is_api_vfs(fstype);
}
bool fstype_is_fuse(const char *fstype) {
assert(fstype);
/* Plain 'fuse', 'fuseblk' (e.g. ntfs-3g, exfat-fuse — used for file systems backed by an actual
* block device), or any 'fuse.<subtype>' (e.g. sshfs, rclone, gvfs, ...). */
return STR_IN_SET(fstype, "fuse", "fuseblk") || startswith(fstype, "fuse.");
}
bool fstype_is_ro(const char *fstype) {
/* All Linux file systems that are necessarily read-only */
return STR_IN_SET(fstype,
-1
View File
@@ -64,7 +64,6 @@ bool fstype_needs_quota(const char *fstype);
bool fstype_has_internal_quota(const char *fstype);
bool fstype_is_api_vfs(const char *fstype);
bool fstype_is_blockdev_backed(const char *fstype);
bool fstype_is_fuse(const char *fstype);
bool fstype_is_ro(const char *fsype);
bool fstype_can_discard(const char *fstype);
bool fstype_can_ownership(const char *fstype);