<table><tr><td style="">bruns added a comment.<br />Restricted Application added a project: Baloo.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5784">View Revision</a></tr></table><br /><div><div><p>The whole function as currently used is pointless.</p>

<p>Currently, it sets the NO_COW flag on BTRFS, but this is insufficient:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">XFS - <a href="https://lwn.net/Articles/747633/" class="remarkup-link" target="_blank" rel="noreferrer">https://lwn.net/Articles/747633/</a></li>
<li class="remarkup-list-item">F2FS</li>
<li class="remarkup-list-item">Hammer2 ?</li>
</ul>

<p>At least on Linux, the correct thing is to *try* to set the no_cow flag, and silently ignore any <tt style="background: #ebebeb; font-size: 13px;">EOPNOTSUPP</tt> errors.</p>

<p>Thats what I get on Linux for:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">File without permission to write: <tt style="background: #ebebeb; font-size: 13px;">ioctl(3, FS_IOC_SETFLAGS, 0x7ffee879084c) = -1 EPERM (Operation not permitted)</tt></li>
<li class="remarkup-list-item">On an old XFS: <tt style="background: #ebebeb; font-size: 13px;">ioctl(3, FS_IOC_SETFLAGS, 0x7fff8e52467c) = -1 EOPNOTSUPP (Operation not supported)</tt></li>
<li class="remarkup-list-item">BTRFS: <tt style="background: #ebebeb; font-size: 13px;">ioctl(3, FS_IOC_SETFLAGS, 0x7fff06817a2c) = 0</tt></li>
</ul>

<p>This way the code is future proof even when a new FS appears or an old one gains new features.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5784">https://phabricator.kde.org/D5784</a></div></div><br /><div><strong>To: </strong>tcberner, FreeBSD, kfunk, poboiko<br /><strong>Cc: </strong>bruns, adridg, kfunk, Frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin<br /></div>