r23508: Fix sync_file() to return NTSTATUS and return this
[sfrench/samba-autobuild/.git] / source / smbd / aio.c
index bee6ebc89a9292381a974fee090fe9db4f439411..f747cf5c065c3a586c137e0ebe715ffed2d74705 100644 (file)
@@ -468,6 +468,7 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
                ret = errno;
         } else {
                BOOL write_through = BITSETW(aio_ex->inbuf+smb_vwv7,0);
+               NTSTATUS status;
 
                SSVAL(outbuf,smb_vwv2,nwritten);
                SSVAL(outbuf,smb_vwv4,(nwritten>>16)&1);
@@ -478,7 +479,13 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
 
                DEBUG(3,("handle_aio_write: fnum=%d num=%d wrote=%d\n",
                         fsp->fnum, (int)numtowrite, (int)nwritten));
-               sync_file(fsp->conn,fsp, write_through);
+               status = sync_file(fsp->conn,fsp, write_through);
+               if (!NT_STATUS_IS_OK(status)) {
+                       UNIXERROR(ERRHRD,ERRdiskfull);
+                       ret = errno;
+                       DEBUG(5,("handle_aio_write: sync_file for %s returned %s\n",
+                               fsp->fsp_name, nt_errstr(status) ));
+               }
        }
 
        show_msg(outbuf);