Krzysztof Sienkiewicz
2016-Jul-18 12:02 UTC
[Samba] File locks are not preserved when IP is moved to another node.
Dear samba maintainers, Recently I was testing samba and ctdb with the glusterfs. Everything works well but I got some problems with file locking. When I exclusively lock a file from one Windows client the second client sees that this file is in use and doesn't allow access - this is correct. But when I move public IP to the second node these locks are lost and it is possible to access the file on the second client machine. There are two servers in cluster, both are connected to domain and running ctdb, samba and winbind. Share is placed on the glusterfs and it is accessible on both nodes. I use two Windows clients to connects to this share. The samba version used is 4.4.3. Samba configuration: [global] workgroup = DEV netbios name = CLUSTER1 vfs objects = fileid acl_xattr fileid:mapping = fsid private dir = /mnt/common/private clustering = yes encrypt passwords = yes domain logons = no log level = 1 syslog = 0 max log size = 6000 socket options = TCP_NODELAY IPTOS_LOWDELAY os level = 0 local master = no preferred master = no domain master = no invalid users = root guest account = nobody map to guest = Bad User wide links = no force unknown acl user = yes winbind separator = + winbind enum users = yes winbind enum groups = yes winbind refresh tickets = yes winbind request timeout = 300 printcap cache time = 0 unix extensions = no server max protocol = SMB3 map acl inherit = yes store dos attributes = yes use spnego = yes map hidden = no map system = no idmap config * : backend = autorid idmap config * : range = 1000000-19999999 idmap config * : rangesize = 1000000 security = ads server role = member realm = DEV.LOCAL workgroup = DEV allow trusted domains = yes [gluster] inherit acls=yes inherit owner=no map acl inherit=yes strict allocate=no locking=yes guest ok=no valid users="DEV+administrator" path=/mnt/glusterfs read only=no guest only=no Content of locking.tdb before "ctdb moveip" ctdb catdb locking.tdb key(24) "\00\00\00\00\00\00\00\00\9E\C7\A8m\B85\91\B0\00\00\00\00\00\00\00\00" dmaster: 1 rsn: 6 data(324) "\FF\F2S\AD\8F9}\04\00\00\02\00\04\00\02\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\A3,\00\00\00\00\00\00\00\00\00\00\01\00\00\00\BAj\EE\EDS_\CE\00\0D\00\00\00\00\00\00\00\03\00\00\00\FF\FF\FF\FF\89\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\D7\BD\8CW\00\00\00\00\0D\FC\08\00\00\00\00\00\00\00\00\00\9E\C7\A8m\B85\91\B0\00\00\00\00\00\00\00\00\A2\A3\E2g\00\00\00\00t\86\1E\00\00\00\00\00\DD\E4)\B2\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\AB\BA\8CW\00\00\00\00\10\E8;\17\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9E\C7\A8m\B85\91\B0\00\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\0F\00\00\00/mnt/glusterfs\00\00\09\00\00\00\00\00\00\00\09\00\00\00test.txt\00\00\00\00\00\00\00\00\D7\BD\8CW\00\00\00\00\0D\FC\08\00\00\00\00\00\AB\BA\8CW\00\00\00\00\10\E8;\17\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" key(24) "\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" dmaster: 1 rsn: 3 data(588) = "\D97z\05e~ v\00\00\02\00\04\00\02\00\00\00\00\00\03\00\00\00\03\00\00\00\00\00\00\00\CE+\00\00\00\00\00\00\00\00\00\00\01\00\00\00\E1#\DB6\CC\CE\BF\FC\05\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00\CD\BD\8CW\00\00\00\00\1Cf\06\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00M\91\98'\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\A3,\00\00\00\00\00\00\00\00\00\00\01\00\00\00\BAj\EE\EDS_\CE\00\09\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00\D2\BD\8CW\00\00\00\00\D1\F3\09\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0C\F6\C3\1C\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\A3,\00\00\00\00\00\00\00\00\00\00\01\00\00\00\BAj\EE\EDS_\CE\00\06\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00\D2\BD\8CW\00\00\00\00\15\AC\09\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\97B\A2\C0\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\0F\00\00\00/mnt/glusterfs\00\00\02\00\00\00\00\00\00\00\02\00\00\00.\00\00\00\00\00\00\00\CD\BD\8CW\00\00\00\00\1Cf\06\00\00\00\00\00\D2\BD\8CW\00\00\00\00\D1\F3\09\00\00\00\00\00\D2\BD\8CW\00\00\00\00\15\AC\09\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" Content of locking.tdb after the "ctdb moveip" ctdb catdb locking.tdb key(24) "\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" dmaster: 0 rsn: 5 data(588) "F\0D\8E.\C9\FA\E5Y\00\00\02\00\04\00\02\00\00\00\00\00\03\00\00\00\03\00\00\00\00\00\00\00\C8\0B\00\00\00\00\00\00\00\00\00\00\00\00\00\00\A57\C32BY\81\E1\04\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00{\BE\8CW\00\00\00\00t>\05\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\96 \0Da\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\C8\0B\00\00\00\00\00\00\00\00\00\00\00\00\00\00\A57\C32BY\81\E1\09\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00{\BE\8CW\00\00\00\00\EB\A5\0E\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\A6\1A\80E\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\CD\0B\00\00\00\00\00\00\00\00\00\00\00\00\00\00\09\0D\A0\F7\7Fd\97\22\10\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\81\00\10\00\07\00\00\00\00\00\00\00\00\00\00\00}\BE\8CW\00\00\00\00\D4-\0E\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00r\B7Zy\00\00\00\00t\86\1E\00\00\00\00\00\0D\B4j\BA\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\0F\00\00\00/mnt/glusterfs\00\00\02\00\00\00\00\00\00\00\02\00\00\00.\00\00\00\00\00\00\00{\BE\8CW\00\00\00\00t>\05\00\00\00\00\00{\BE\8CW\00\00\00\00\EB\A5\0E\00\00\00\00\00}\BE\8CW\00\00\00\00\D4-\0E\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" Dumped 1 records The first record with lock is lost. I also tested it with following options but it didn't help: posix locking = no kernel oplocks = no kernel share modes = no The ctdb configuration: /etc/default/ctdb CTDB_RECOVERY_LOCK=/mnt/common/ctdb.lock CTDB_NODES=/etc/ctdb/nodes CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses CTDB_MANAGES_SAMBA=yes CTDB_MANAGES_WINBIND=yes CTDB_LOGGING=file:/var/log/log.ctdb CTDB_SET_TraverseTimeout=60 CTDB_SET_EventScriptTimeout=120 /etc/ctdb/nodes 192.168.176.11 192.168.176.14 /etc/ctdb/public_addresses 123.123.123.155/24 eth0 Does this lock should be preserved after moving the IP or do I have something wrong in my configuration? Thank you in advance.
Volker Lendecke
2016-Jul-18 12:45 UTC
[Samba] File locks are not preserved when IP is moved to another node.
On Mon, Jul 18, 2016 at 02:02:46PM +0200, Krzysztof Sienkiewicz wrote:> Recently I was testing samba and ctdb with the glusterfs. Everything works > well but I got some problems with file locking. When I exclusively lock a > file from one Windows client the second client sees that this file is in > use and doesn't allow access - this is correct. But when I move public IP > to the second node these locks are lost and it is possible to access the > file on the second client machine. > > There are two servers in cluster, both are connected to domain and running > ctdb, samba and winbind. Share is placed on the glusterfs and it is > accessible on both nodes. I use two Windows clients to connects to this > share. The samba version used is 4.4.3.What you need is persistent file handles, which are right now not present in Samba, sorry for that. With best regards, Volker Lendecke