From 3ab73c0cd740a44e1e111bbbbe9fe32776bb7fb2 Mon Sep 17 00:00:00 2001 From: zaf <80886145+RushingAlien@users.noreply.github.com> Date: Thu, 6 Mar 2025 21:44:36 +0700 Subject: [PATCH] Fix btrfs lingering mounts Btrfs has an issue where mount can linger after a sudden device disconnect, this is very apparent with USB storage. the psuedo mount option x-systemd.device-bound overrides the default `Requires` dependency to that of `BindsTo` which will automatically stop the mount if the device became inactive. Partly fixes https://github.com/storaged-project/udisks/issues/1359 Please list more filesystems susceptible to lingering mounts in https://github.com/storaged-project/udisks/issues/1359 so they can be covered as well. --- data/builtin_mount_options.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/builtin_mount_options.conf b/data/builtin_mount_options.conf index 2a09a1098..9f8fc8b69 100644 --- a/data/builtin_mount_options.conf +++ b/data/builtin_mount_options.conf @@ -29,7 +29,8 @@ udf_allow=uid=$UID,gid=$GID,iocharset,utf8,umask,mode,dmode,unhide,undelete hfsplus_defaults=uid=$UID,gid=$GID,nls=utf8 hfsplus_allow=uid=$UID,gid=$GID,creator,type,umask,session,part,decompose,nodecompose,force,nls -btrfs_allow=compress,compress-force,datacow,nodatacow,datasum,nodatasum,autodefrag,noautodefrag,degraded,device,discard,nodiscard,subvol,subvolid,space_cache +btrfs_allow=compress,compress-force,datacow,nodatacow,datasum,nodatasum,autodefrag,noautodefrag,degraded,device,discard,nodiscard,subvol,subvolid,space_cache,x-systemd.device-bound +btrfs_defaults=x-systemd.device-bound f2fs_allow=discard,nodiscard,compress_algorithm,compress_log_size,compress_extension,compress_chksum,alloc_mode,atgc,gc_merge,nogc_merge