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

Alex Crow acrow at integrafin.co.uk
Sun Oct 23 18:53:41 UTC 2016


OK, first test is opening twice from the same client, we expect this to
break (as by definition it accesses the same host).

[root at s4files1 ~]# smbclient -U"MY_NET\ajc" //172.31.0.120/ifa_x
Enter MY_NET\user's password:
Domain=[MY_NET] OS=[Windows 6.1] Server=[Samba 4.4.6-SerNet-RedHat-33.el7]
smb: \> ls
  .                                   D        0  Sun Oct 23 19:18:58 2016
  ..                                  D        0  Thu Oct 20 19:19:21 2016
  test.txt                            A        0  Sun Oct 23 19:18:58 2016
  SW_DVD5_Office_2010_W32_English_MLF_X16-51904      D        0  Wed Mar
31 03:02:55 2010

        171358464 blocks of size 1024. 167913856 blocks available
smb: \> open test.txt
open file \test.txt: for read/write fnum 50796
smb: \> open test.txt
Failed to open file \test.txt. NT_STATUS_SHARING_VIOLATION
smb: \>


OK, so the locking works fine from smbclient just pointing to one host
in the CTDB cluster.

So now I'll try accessing the same file again, but using the second host
(leaving the first client open):

[root at s4files2 ~]# smbclient -U"MY_NET\ajc" //172.31.0.121/ifa_x
Enter MY_NET\ajc's password:
Domain=[MY_NET] OS=[Windows 6.1] Server=[Samba 4.4.6-SerNet-RedHat-33.el7]
smb: \> ls
  .                                   D        0  Sun Oct 23 19:18:58 2016
  ..                                  D        0  Thu Oct 20 19:19:21 2016
  test.txt                            A        0  Sun Oct 23 19:18:58 2016
  SW_DVD5_Office_2010_W32_English_MLF_X16-51904      D        0  Wed Mar
31 03:02:55 2010

        171358464 blocks of size 1024. 167913856 blocks available
smb: \> open test.txt
open file \test.txt: for read/write fnum 26479
smb: \>

Bingo - seems smbd does not care about the CTDB locks reported by:

[root at s4files1 ~]# smbstatus -L
Locked files:
Pid          Uid        DenyMode   Access      R/W       
Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
0:12886      1046       DENY_ALL   0x83        RDWR      
NONE             /mfs/samba/drive_x   test.txt   Sun Oct 23 19:27:17 2016
1:1593       1046       DENY_ALL   0x83        RDWR      
NONE             /mfs/samba/drive_x   test.txt   Sun Oct 23 19:19:13 2016


When I get the chance I will up the server logs to level 10 and get back
to you.

Cheers

Alex

--
This message is intended only for the addressee and may contain
confidential information. Unless you are that person, you may not
disclose its contents or use it in any way and are requested to delete
the message along with any attachments and notify us immediately.
This email is not intended to, nor should it be taken to, constitute advice.
The information provided is correct to our knowledge & belief and must not
be used as a substitute for obtaining tax, regulatory, investment, legal or
any other appropriate advice.

"Transact" is operated by Integrated Financial Arrangements Ltd.
29 Clement's Lane, London EC4N 7AE. Tel: (020) 7608 4900 Fax: (020) 7608 5300.
(Registered office: as above; Registered in England and Wales under
number: 3727592). Authorised and regulated by the Financial Conduct
Authority (entered on the Financial Services Register; no. 190856).



More information about the samba mailing list