[PATCH] Fix bug #13121 - Non-smbd processes using kernel oplocks can hang smbd

Andrew Bartlett abartlet at samba.org
Wed Nov 29 22:50:50 UTC 2017


On Wed, 2017-11-29 at 14:13 -0800, Jeremy Allison wrote:
> On Thu, Nov 30, 2017 at 11:05:39AM +1300, Andrew Bartlett wrote:
> > On Thu, 2017-11-30 at 06:23 +1300, Andrew Bartlett wrote:
> > > On Wed, 2017-11-29 at 08:43 -0800, Jeremy Allison wrote:
> > > > 
> > > > Thanks for persevering with this. I'm OK with you
> > > > marking it flakey now you can reproduce locally.
> > > 
> > > Good.
> > 
> > I've done the fixes required for the test, and I'll push it shortly.  
> > 
> > This is a 'real' flapping test, it also flaps on sn-devel if you run
> > the loop for long enough.
> 
> Thanks a lot ! I'm very puzzled by the error 10 though - it
> means a missing RT signal. I'll try and get some time to
> investigate with a standalone program.

Here is the patch for that.  Gary has reviewed it and it is in
autobuild.  I wish you the best with finding a real fix!

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   
https://catalyst.net.nz/services/samba



-------------- next part --------------
From bb1f4b1c21f31521b7c26bed1bea7efdbd336c0d Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Thu, 30 Nov 2017 09:35:20 +1300
Subject: [PATCH 1/2] torture: Use torture_assert{,_int_equal}_goto() in
 smb2.kernel-oplocks

This allows this test to be added as flapping.

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
---
 source4/torture/smb2/oplock.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c
index b6d9f842336..6d749f92c1c 100644
--- a/source4/torture/smb2/oplock.c
+++ b/source4/torture/smb2/oplock.c
@@ -5040,7 +5040,8 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx,
 	io.in.fname = fname;
 
 	req = smb2_create_send(tree, &io);
-	torture_assert(tctx, req != NULL, "smb2_create_send");
+	torture_assert_goto(tctx, req != NULL,
+			    ret, done, "smb2_create_send");
 
 	/* Ensure while the open is blocked the smbd is
 	   still serving other requests. */
@@ -5058,7 +5059,8 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx,
 	h1 = io.out.file.handle;
 
 	/* in less than 2 seconds. Otherwise the server blocks. */
-	torture_assert(tctx, end - start < 2, "server was blocked !");
+	torture_assert_goto(tctx, end - start < 2,
+			    ret, done, "server was blocked !");
 
 	/* Pick up the return for the initial blocking open. */
 	status = smb2_create_recv(req, tctx, &io);
@@ -5071,14 +5073,12 @@ static bool test_smb2_kernel_oplocks8(struct torture_context *tctx,
 	/* Wait for the exit code from the child. */
 	while (child_exit_code == -1) {
 		int rval = tevent_loop_once(tctx->ev);
-		torture_assert(tctx, rval == 0, "tevent_loop_once error\n");
+		torture_assert_goto(tctx, rval == 0, ret,
+				    done, "tevent_loop_once error\n");
 	}
 
-	if (child_exit_code != 0) {
-		torture_comment(tctx, "Bad child exit code %d\n",
-			child_exit_code);
-		ret = false;
-	}
+	torture_assert_int_equal_goto(tctx, child_exit_code, 0,
+				      ret, done, "Bad child exit code");
 
 done:
 	if (!smb2_util_handle_empty(h1)) {
-- 
2.11.0


From ca523c89c00416c2f656ed60a10aad8ab05bc72e Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Thu, 30 Nov 2017 09:38:13 +1300
Subject: [PATCH 2/2] selftest: mark samba3.smb2.kernel-oplocks as flapping

This flaps on sn-devel occaionally, and more often elsewhere

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
---
 selftest/flapping.d/kernel-oplocks | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 selftest/flapping.d/kernel-oplocks

diff --git a/selftest/flapping.d/kernel-oplocks b/selftest/flapping.d/kernel-oplocks
new file mode 100644
index 00000000000..2102e2bf363
--- /dev/null
+++ b/selftest/flapping.d/kernel-oplocks
@@ -0,0 +1,4 @@
+# The smb2.kernel-oplocks tests fails often on Ubuntu 14.04 on the
+# Catalyst Cloud but failures have been seen on normal workstations
+# and sn-devel.
+^samba3.smb2.kernel-oplocks.kernel_oplocks8
-- 
2.11.0



More information about the samba-technical mailing list