scst_vdisk: Suggest to disable thin provisioning for ZFS

Apparently ZFS does not support FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE.
Hence suggest to disable thin provisioning if fallocate() returns -EOPNOTSUPP.
See also https://github.com/zfsonlinux/zfs/issues/326.

Reported-by: Sietse van Zanen <sietse@wizdom.nu>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-05-05 15:59:00 +00:00
parent 47d3ba1f99
commit b56d9ce600

View File

@@ -1794,7 +1794,11 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd,
res = fd->f_op->fallocate(fd,
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, len);
if (unlikely(res != 0)) {
if (unlikely(res == -EOPNOTSUPP)) {
PRINT_WARNING_ONCE("%s: fallocate() is not supported. Consider setting 'thin_provisioned' to 0 in scst.conf.\n",
virt_dev->name);
res = 0;
} else if (unlikely(res != 0)) {
PRINT_WARNING_ONCE("fallocate() for %lld, len %lld "
"failed: %d", (unsigned long long)off,
(unsigned long long)len, res);