[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-636-g9258ade

Tim Prouty tprouty at samba.org
Thu Apr 2 03:12:30 GMT 2009


The branch, v3-4-test has been updated
       via  9258adeac95e7fca025a72ce39e2d70fa5a665cd (commit)
      from  dd495878d764c3836784adcd739f78ca03d27d58 (commit)

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


- Log -----------------------------------------------------------------
commit 9258adeac95e7fca025a72ce39e2d70fa5a665cd
Author: Tim Prouty <tprouty at samba.org>
Date:   Thu Apr 2 03:01:34 2009 +0000

    s3 onefs: Quiet a log message about oplocks being requested on streams
    (cherry picked from commit 87fe4d732d18d18ed56c99cba6a395a0bf9e9d95)

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

Summary of changes:
 source3/modules/onefs_open.c |   37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 382e493..b0f31b9 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -199,23 +199,6 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
 	if ((conn->fs_capabilities & FILE_NAMED_STREAMS) && stream != NULL) {
 		SMB_ASSERT(fsp->base_fsp);
 
-		/*
-		 * We have never seen an oplock taken on a stream, and our
-		 * current implementation doesn't support it.  If a request is
-		 * seen, log a loud error message and ignore the requested
-		 * oplock.
-		 */
-		if ((oplock_request & ~SAMBA_PRIVATE_OPLOCK_MASK) !=
-		     NO_OPLOCK) {
-			DEBUG(0, ("Oplock(%d) being requested on a stream! "
-				  "Ignoring oplock request: base=%s, "
-				  "stream=%s\n",
-				  oplock_request & ~SAMBA_PRIVATE_OPLOCK_MASK,
-				  base, stream));
-			/* Recover by requesting NO_OPLOCK instead. */
-			oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
-		}
-
 		DEBUG(10,("Opening a stream: base=%s(%d), stream=%s\n",
 			  base, fsp->base_fsp->fh->fd, stream));
 
@@ -531,10 +514,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 	 *
 	 *   1. Open the base file of a stream: Always done stat-only
 	 *
-	 *   2. Open the stream: Oplocks are disallowed on streams, so an
-	 *      oplock will never be contended.
-	 *
-	 *   3. open_file_fchmod(), which is called from 3 places:
+	 *   2. open_file_fchmod(), which is called from 3 places:
 	 *      A. try_chown: Posix acls only. Never called on onefs.
 	 *      B. set_ea_dos_attributes: Can't be called from onefs, because
 	 *         SMB_VFS_SETXATTR return ENOSYS.
@@ -1782,6 +1762,21 @@ static NTSTATUS onefs_create_file_unixpath(connection_struct *conn,
 				  "failed: %s\n", base, nt_errstr(status)));
 			goto fail;
 		}
+
+		/*
+		 * Testing against windows xp/2003/vista shows that oplocks
+		 * can actually be requested and granted on streams (see the
+		 * RAW-OPLOCK-STREAM1 smbtorture test).
+		 */
+		if ((oplock_request & ~SAMBA_PRIVATE_OPLOCK_MASK) !=
+		     NO_OPLOCK) {
+			DEBUG(5, ("Oplock(%d) being requested on a stream! "
+				  "Ignoring oplock request: fname=%s\n",
+				  oplock_request & ~SAMBA_PRIVATE_OPLOCK_MASK,
+				  fname));
+			/* Request NO_OPLOCK instead. */
+			oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
+		}
 	}
 
 	/* Covert generic bits in the security descriptor. */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list