diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2023-12-01 09:27:59 +0000 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2023-12-04 06:51:33 +0000 |
commit | 094abb6fb41c07c0266a5cae84a7439289a978e9 (patch) | |
tree | d2040dc9824936c7a90534ed1daffd9e973f025a | |
parent | 0a958aa16fed1978879d64e3b225f1d232cc5a98 (diff) | |
download | src-094abb6fb41c07c0266a5cae84a7439289a978e9.tar.gz src-094abb6fb41c07c0266a5cae84a7439289a978e9.zip |
autofs: media: Always use sync option for fat*
Users of autofs for removable media expect to be able to copy files and
directly remove the media without having the need to call sync(8) or umount(8).
Only do that for fat/ntfs filesystems.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D42494
Reviewed by: rew (older version)
-rwxr-xr-x | usr.sbin/autofs/autofs/special_media | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/autofs/autofs/special_media b/usr.sbin/autofs/autofs/special_media index 33fa4544d028..b397a8889623 100755 --- a/usr.sbin/autofs/autofs/special_media +++ b/usr.sbin/autofs/autofs/special_media @@ -40,7 +40,7 @@ print_map_entry() { case "${_fstype}" in "exfat") if [ -f "/usr/local/sbin/mount.exfat" ]; then - echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype} :/dev/${_p}" + echo "-mountprog=/usr/local/sbin/mount.exfat,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-exfat first" @@ -49,14 +49,17 @@ print_map_entry() { ;; "ntfs") if [ -f "/usr/local/bin/ntfs-3g" ]; then - echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype} :/dev/${_p}" + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},sync :/dev/${_p}" else /usr/bin/logger -p info -t "special_media[$$]" \ "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" exit 1 fi ;; - "ext2fs" | "msdosfs") + "msdosfs") + echo "-fstype=${_fstype},sync :/dev/${_p}" + ;; + "ext2fs") echo "-fstype=${_fstype},async :/dev/${_p}" ;; *) |