mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-21 20:51:27 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user