[Samba] CTDB and locking issues in 4.4.6 (Classic domain)

Ralph Böhme slow at samba.org
Fri Oct 21 17:06:27 UTC 2016


On Fri, Oct 21, 2016 at 05:48:52PM +0100, Alex Crow via samba wrote:
> 
> > I've now managed to replicate the error on my test setup. I added a
> > third host and all hell broke loose - no locking at all when opening
> > Excel files apart from same-host. It seemed fine with two.
> > 
> > I then downgraded to 4.4.5 and the problem persisted. So it cannot be a
> > regression from that patch.
> > 
> > Regards,
> > 
> > Alex
> > 
> Here you go:
> 
> Locked files:
> Pid          Uid        DenyMode   Access      R/W Oplock
> SharePath   Name   Time
> --------------------------------------------------------------------------------------------------
> 1:11489      1046       DENY_WRITE 0x12019f    RDWR NONE
> /mfs/samba/drive_v   jmi/Corporate Accounting/ISL Ltd
> Accounts/2016/1609/201609 213_ ISL Balance sheet variance analysis.xls   Fri
> Oct 21 17:27:22 2016
> 
> 0:9375       1046       DENY_WRITE 0x12019f    RDWR NONE
> /mfs/samba/drive_v   jmi/Corporate Accounting/ISL Ltd
> Accounts/2016/1609/201609 213_ ISL Balance sheet variance analysis.xls   Fri
> Oct 21 17:26:38 2016
> 
> This is what I'm seeing. I could open the same file r/w off two different
> hosts. Both seem to have a DENY_WRITE lock - which is surely supposed to be
> impossible?
> 
> This is on 4.4.5 with only two hosts operational.

*phew*! At least it's not a regression by the patches for bug 12005.

Can you try to reproduce the issue with a specially patched smbclient?
Attached patch modifies the smbclient open command to request deny
read and write sharemodes, so any two opens should conflict:

smb: \> open test
open file \test: for read/write fnum 1

smb: \> open test
Failed to open file \test. NT_STATUS_SHARING_VIOLATION

Without the patch the opens would succeed:

smb: \> open test
open file \test: for read/write fnum 1
smb: \> open test
open file \test: for read/write fnum 2

If you can reproduce the issue with smbclient, please set loglevel to
10 on both nodes and reproduce the issue with smbclient. Reproducing
the issue with smbclient instead of Excel reduces the noise and should
make it easier to analyse.

Please setup logging in a way so that we get per client logfiles, eg
"log file = /var/log/samba/%m.log".

Cheerio!
-slow
-------------- next part --------------
From f3afbd793ec5a1f37b63663fa8c49d26afde0f7c Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 21 Oct 2016 14:21:39 +0200
Subject: [PATCH] HACK: smbclient: open with deny read and deny write
 sharemodes

---
 source3/client/client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source3/client/client.c b/source3/client/client.c
index 831b9bc..28e98af 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2498,12 +2498,12 @@ static int cmd_open(void)
 
 	status = cli_ntcreate(targetcli, targetname, 0,
 			FILE_READ_DATA|FILE_WRITE_DATA, 0,
-			FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
+			0, FILE_OPEN,
 			0x0, 0x0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		status = cli_ntcreate(targetcli, targetname, 0,
 				FILE_READ_DATA, 0,
-				FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
+				0, FILE_OPEN,
 				0x0, 0x0, &fnum, NULL);
 		if (NT_STATUS_IS_OK(status)) {
 			d_printf("open file %s: for read/write fnum %d\n", targetname, fnum);
-- 
2.7.4



More information about the samba mailing list