Update position information also for AIO
authorVolker Lendecke <vl@samba.org>
Tue, 19 Feb 2008 12:27:08 +0000 (13:27 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 19 Feb 2008 15:19:49 +0000 (16:19 +0100)
Necessary to survive RAW-SEEK with AIO enabled.

Jeremy, please check!

source/smbd/aio.c

index 5515582eecc10b5438c3caff56bda6958a144d73..8c6eaf1498fa8b33cf3f7fe4c7fb58e4cb02be1c 100644 (file)
@@ -423,6 +423,9 @@ static int handle_aio_read_complete(struct aio_extra *aio_ex)
                SSVAL(outbuf,smb_vwv7,((nread >> 16) & 1));
                SSVAL(smb_buf(outbuf),-2,nread);
 
+               aio_ex->fsp->fh->pos = aio_ex->acb.aio_offset + nread;
+               aio_ex->fsp->fh->position_information = aio_ex->fsp->fh->pos;
+
                DEBUG( 3, ( "handle_aio_read_complete file %s max=%d "
                            "nread=%d\n",
                            aio_ex->fsp->fsp_name,
@@ -524,6 +527,8 @@ static int handle_aio_write_complete(struct aio_extra *aio_ex)
                        DEBUG(5,("handle_aio_write: sync_file for %s returned %s\n",
                                fsp->fsp_name, nt_errstr(status) ));
                }
+
+               aio_ex->fsp->fh->pos = aio_ex->acb.aio_offset + nwritten;
        }
 
        show_msg(outbuf);