[PATCH] fallocate returned values on failure

Jones jones.kstw at gmail.com
Wed Dec 3 23:02:38 MST 2014

Hello list,

There is samba-4.0.5 in the linux box,
and set strict allocate = yes to go through fallocate api.

Found if fallocate() returns -1 with errno = ENOSPC,
cannot catch by error handling as followings:
             offset, num_to_write);
  if (ret == ENOSPC) {
  errno = ENOSPC;
ret = -1;
        goto out;

Per man pages said,
posix_fallocate() returns an error number on failure,
fallocate() returns -1 on failure.

Patch as attached could handle -1 returned from fallocate() on failure,
please help review and any suggestions are appreciated,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: look.patch
Type: application/octet-stream
Size: 1509 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141204/db819349/attachment.obj>

More information about the samba-technical mailing list