s3-aio: Use correct locking context for SMB2
authorChristof Schmitt <cs@samba.org>
Thu, 5 Dec 2013 22:57:54 +0000 (15:57 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 6 Dec 2013 02:22:16 +0000 (18:22 -0800)
The synchronous SMB2 reads and writes use open_persistent_id. The AIO
codepathes have to use the same, otherwise a write will conflict with a
lock on the same open file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/aio.c

index 24a822e3fd89df7ce7178f66a400c910760bd7b7..eec29f664f3379ed54f0144f2c041f5bc7082b1d 100644 (file)
@@ -720,7 +720,7 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
                return NT_STATUS_NO_MEMORY;
        }
 
                return NT_STATUS_NO_MEMORY;
        }
 
-       init_strict_lock_struct(fsp, (uint64_t)smbreq->smbpid,
+       init_strict_lock_struct(fsp, fsp->op->global->open_persistent_id,
                (uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
                &aio_ex->lock);
 
                (uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
                &aio_ex->lock);
 
@@ -872,7 +872,7 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
 
        aio_ex->write_through = write_through;
 
 
        aio_ex->write_through = write_through;
 
-       init_strict_lock_struct(fsp, (uint64_t)smbreq->smbpid,
+       init_strict_lock_struct(fsp, fsp->op->global->open_persistent_id,
                in_offset, (uint64_t)in_data.length, WRITE_LOCK,
                &aio_ex->lock);
 
                in_offset, (uint64_t)in_data.length, WRITE_LOCK,
                &aio_ex->lock);