The branch, v3-2-test has been updated
       via  27b1ae601542ebe2e23ab4ff81eb14f8e03a3caf (commit)
      from  dc04b5adf7569b3501cb95f86d01e00276b41c23 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 27b1ae601542ebe2e23ab4ff81eb14f8e03a3caf
Author: Andrew Tridgell <[EMAIL PROTECTED]>
Date:   Sun Aug 24 13:58:05 2008 +1000

    become root for AIO operations
    
    We need to become root for AIO read and write to allow the AIO thread
    to send a completion signal to the parent process when the IO
    completes

-----------------------------------------------------------------------

Summary of changes:
 source/smbd/aio.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/aio.c b/source/smbd/aio.c
index 2889e3c..7427536 100644
--- a/source/smbd/aio.c
+++ b/source/smbd/aio.c
@@ -268,12 +268,15 @@ bool schedule_aio_read_and_X(connection_struct *conn,
        a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
        a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
 
+       become_root();
        if (SMB_VFS_AIO_READ(fsp,a) == -1) {
                DEBUG(0,("schedule_aio_read_and_X: aio_read failed. "
                         "Error %s\n", strerror(errno) ));
                delete_aio_ex(aio_ex);
+               unbecome_root();
                return False;
        }
+       unbecome_root();
 
        DEBUG(10,("schedule_aio_read_and_X: scheduled aio_read for file %s, "
                  "offset %.0f, len = %u (mid = %u)\n",
@@ -366,13 +369,16 @@ bool schedule_aio_write_and_X(connection_struct *conn,
        a->aio_sigevent.sigev_signo  = RT_SIGNAL_AIO;
        a->aio_sigevent.sigev_value.sival_int = aio_ex->mid;
 
+       become_root();
        if (SMB_VFS_AIO_WRITE(fsp,a) == -1) {
                DEBUG(3,("schedule_aio_wrote_and_X: aio_write failed. "
                         "Error %s\n", strerror(errno) ));
                delete_aio_ex(aio_ex);
+               unbecome_root();
                return False;
        }
-
+       unbecome_root();
+       
        release_level_2_oplocks_on_change(fsp);
 
        if (!write_through && !lp_syncalways(SNUM(fsp->conn))


-- 
Samba Shared Repository

Reply via email to