diff --git a/src/engine/fsutils.h b/src/engine/fsutils.h --- a/src/engine/fsutils.h +++ b/src/engine/fsutils.h @@ -38,14 +38,10 @@ /** * Disables filesystem copy-on-write feature on given file or directory. - * Only works on Linux and does nothing on other platforms. - * - * It was tested only with Btrfs but in theory can be called on any FS that - * supports NOCOW. + * Only implemented on Linux and does nothing on other platforms. */ void disableCoW(const QString &path); } - } #endif diff --git a/src/engine/fsutils.cpp b/src/engine/fsutils.cpp --- a/src/engine/fsutils.cpp +++ b/src/engine/fsutils.cpp @@ -92,14 +92,22 @@ } if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1) { - qWarning() << "ioctl error: failed to get file flags (" << errno << ")"; + const int errno_ioctl = errno; + // ignore ENOTTY, filesystem does not support attrs (and likely neither supports COW) + if (errno_ioctl != ENOTTY) { + qWarning() << "ioctl error: failed to get file flags (" << errno_ioctl << ")"; + } close(fd); return; } if (!(flags & FS_NOCOW_FL)) { flags |= FS_NOCOW_FL; if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1) { - qWarning() << "ioctl error: failed to set file flags (" << errno << ")"; + const int errno_ioctl = errno; + // ignore EOPNOTSUPP, returned on filesystems not supporting COW + if (errno_ioctl != EOPNOTSUPP) { + qWarning() << "ioctl error: failed to set file flags (" << errno_ioctl << ")"; + } close(fd); return; }