bruns added a comment. Restricted Application added a project: Baloo.
The whole function as currently used is pointless. Currently, it sets the NO_COW flag on BTRFS, but this is insufficient: - XFS - https://lwn.net/Articles/747633/ - F2FS - Hammer2 ? At least on Linux, the correct thing is to *try* to set the no_cow flag, and silently ignore any `EOPNOTSUPP` errors. Thats what I get on Linux for: - File without permission to write: `ioctl(3, FS_IOC_SETFLAGS, 0x7ffee879084c) = -1 EPERM (Operation not permitted)` - On an old XFS: `ioctl(3, FS_IOC_SETFLAGS, 0x7fff8e52467c) = -1 EOPNOTSUPP (Operation not supported)` - BTRFS: `ioctl(3, FS_IOC_SETFLAGS, 0x7fff06817a2c) = 0` This way the code is future proof even when a new FS appears or an old one gains new features. REPOSITORY R293 Baloo REVISION DETAIL https://phabricator.kde.org/D5784 To: tcberner, #freebsd, kfunk, poboiko Cc: bruns, adridg, kfunk, #frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin