[PATCH] fallocate returned values on failure
Jones
jones.kstw at gmail.com
Thu Dec 4 17:44:27 MST 2014
Hello Jeremy,
Thanks! Will test this patch ASAP!
And one more thing,
returns -1 between contend_level2_oplock_{begin,end} pairs
looks a bit concern to me,
perhaps move them after contend_level2_oplocks_end() ?
contend_level2_oplocks_begin(fsp, LEVEL2_CONTEND_ALLOC_GROW);
if (lp_strict_allocate(SNUM(fsp->conn))) {
/* See if we have a syscall that will allocate beyond
end-of-file without changing EOF. */
ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_KEEP_SIZE, 0, len);
} else {
ret = 0;
}
contend_level2_oplocks_end(fsp, LEVEL2_CONTEND_ALLOC_GROW);
+ if (ret == -1 && errno == ENOSPC) {
+ return -1;
+ }
if (ret == 0) {
/* We changed the allocation size on disk, but not
EOF - exactly as required. We're done ! */
return 0;
}
--
Regards,
Jones
More information about the samba-technical
mailing list