a few cleanup patches

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Oct 25 04:18:57 MDT 2013


On Fri, Oct 25, 2013 at 10:54:17AM +0200, David Disseldorp wrote:
> On Thu, 24 Oct 2013 20:56:24 +0200
> Volker Lendecke <Volker.Lendecke at SerNet.DE> wrote:
> 
> > On Thu, Oct 24, 2013 at 09:59:19AM -0700, Jeremy Allison wrote:
> > > There's a behavior change in this hunk I think might need
> > > addressing.
> > 
> > Attached find a patch that reverts the controversial patch
> > and the patch that depends on it. For this code we need to
> > prove with automated tests that we have a behaviour change.
> > So please push this until we have torture test cases that
> > excercise the behaviour that was accidentially changed. I'll
> > work on this.
> 
> Please add your SOB line. A short description in the changelog (like
> above) would be nice too.

Attached.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 83eaf58022cee1a6d4f4f46a5bbd6a4e9a5a5806 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 24 Oct 2013 20:53:32 +0200
Subject: [PATCH 1/2] Revert "smbd: Move oplock handling together"

This reverts commit e689b7d51e6ffd848ab10e160dca2c3a03fc750b.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/open.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8ae2246..28c2c1c 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -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);
-- 
1.7.9.5


From 6b7a65f4c2e0feb1050d766f61c487b442f800d1 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 24 Oct 2013 20:53:36 +0200
Subject: [PATCH 2/2] Revert "smbd: Move oplock/sharemode ops into one place"

This reverts commit 7b70fa18734d9ceb020fe3e5d4cc0c26cd27a484.

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

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/open.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 28c2c1c..4db673a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1435,6 +1435,13 @@ static void grant_fsp_oplock_type(files_struct *fsp,
 		fsp->oplock_type = NO_OPLOCK;
 	}
 
+	if (is_stat_open(fsp->access_mask)) {
+		/* Leave the value already set. */
+		DEBUG(10,("grant_fsp_oplock_type: oplock type 0x%x on file %s\n",
+			fsp->oplock_type, fsp_str_dbg(fsp)));
+		return;
+	}
+
 	got_level2_oplock = false;
 	got_a_none_oplock = false;
 
@@ -2610,6 +2617,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 		return status;
 	}
 
+	grant_fsp_oplock_type(fsp, lck, oplock_request);
+
 	/*
 	 * We have the share entry *locked*.....
 	 */
@@ -2671,7 +2680,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 	if (file_existed) {
 		/* stat opens on existing files don't get oplocks. */
 		if (is_stat_open(open_access_mask)) {
-			oplock_request = NO_OPLOCK;
+			fsp->oplock_type = NO_OPLOCK;
 		}
 	}
 
@@ -2694,8 +2703,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 	 * file structs.
 	 */
 
-	grant_fsp_oplock_type(fsp, lck, oplock_request);
-
 	status = set_file_oplock(fsp);
 	if (!NT_STATUS_IS_OK(status)) {
 		/*
-- 
1.7.9.5



More information about the samba-technical mailing list