From cc35d1300d487c65f1dc8a275140701ba276adaf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 15 Jun 2007 19:24:04 +0000 Subject: r23508: Fix sync_file() to return NTSTATUS and return this on failure in the write path. Jeremy. (This used to be commit cd3f7dbee809fb40194af0e7509142166e02b252) --- source3/smbd/aio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/smbd/aio.c') diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index bee6ebc89a..f747cf5c06 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -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); -- cgit