[PATCH] fallocate returned values on failure

Jones jones.kstw at gmail.com
Thu Dec 4 02:02:26 MST 2014


Hello Jeremy,

After applied this patch,
per my test still need to add 3 lines as followings,
are these 3 lines correct?

int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
{
...
    ret = SMB_VFS_FALLOCATE(fsp, VFS_FALLOCATE_KEEP_SIZE, 0, len);

    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

2014-12-04 14:37 GMT+08:00 Jeremy Allison <jra at samba.org>:

> On Thu, Dec 04, 2014 at 02:33:10PM +0800, Jones wrote:
> > Hello Jeremy,
> >
> > Thanks for kindly feedback!
> > Sure i would like to test it!
> >
> > Link:
> > https://bugzilla.samba.org/show_bug.cgi?id=10982
>
> Thanks. Here is the quick version that applies
> against master.
>
> It standardizes all *fallocate* calls (including
> the slow_fallocate one) on the -1,errno error
> return convention.
>
> If you can confirm it works for you I'll split
> it up correctly and get it into master and
> back-ported for 4.x.x.
>
> Thanks !
>
> Jeremy.
>


More information about the samba-technical mailing list