Revert "smbd: Move oplock handling together"
authorVolker Lendecke <vl@samba.org>
Thu, 24 Oct 2013 18:53:32 +0000 (20:53 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 25 Oct 2013 10:33:30 +0000 (12:33 +0200)
This reverts commit e689b7d51e6ffd848ab10e160dca2c3a03fc750b.

This is a change in behaviour which needs much further investigation
and testing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source3/smbd/open.c

index 8ae22467948d6825ff7a82be66ebb8d0d0c303cc..28c2c1c844804c900f66c3f6f7b66ff850d70cf4 100644 (file)
@@ -2668,6 +2668,13 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                fsp->access_mask = access_mask | FILE_READ_ATTRIBUTES;
        }
 
+       if (file_existed) {
+               /* stat opens on existing files don't get oplocks. */
+               if (is_stat_open(open_access_mask)) {
+                       oplock_request = NO_OPLOCK;
+               }
+       }
+
        if (new_file_created) {
                info = FILE_WAS_CREATED;
        } else {
@@ -2687,13 +2694,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
         * file structs.
         */
 
-       if (file_existed) {
-               /* stat opens on existing files don't get oplocks. */
-               if (is_stat_open(open_access_mask)) {
-                       oplock_request = NO_OPLOCK;
-               }
-       }
-
        grant_fsp_oplock_type(fsp, lck, oplock_request);
 
        status = set_file_oplock(fsp);