[SCM] Samba Shared Repository - branch v4-3-test updated
Karolin Seeger
kseeger at samba.org
Wed Aug 10 12:59:05 UTC 2016
The branch, v4-3-test has been updated
via 68d13b1 dbwrap_ctdb: treat empty records in ltdb as non-existing
via f7718e4 s4/torture: add a test for ctdb-tombstrone-record deadlock
via dfa1254 smbd: ignore ctdb tombstone records in fetch_share_mode_unlocked_parser()
via 15bcc4a ctdb-daemon: Fix CID 1125627 Resource leak (RESOURCE_LEAK)
via 09cbfa6 ctdb-common: Fix CID 1125585 Dereference after null check (FORWARD_NULL)
via 07f7295 ctdb-common: Fix CID 1125583 Dereference after null check (FORWARD_NULL)
via 49211ba ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL)
via 1f47aa8 ctdb-daemon: Fix CID 1363067 Resource leak (RESOURCE_LEAK)
via 6e36080 ctdb-daemon: Fix CID 1363233 Resource leak (RESOURCE_LEAK)
via 5a864c9 ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
via 1d33681 ctdb-common: Consistently use strlcpy() on interface names
via e5d0277 ctdb-common: Fix CID 1125553 Buffer not null terminated (BUFFER_SIZE_WARNING)
via 32b3c96 ctdb-daemon: Fix CID 1364527/8/9: Null pointer dereferences (NULL_RETURNS)
from 358c3a0 ctdb-scripts: Fix regression in updateip code
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-test
- Log -----------------------------------------------------------------
commit 68d13b1d50e19594503f40872413ecdacab24fbe
Author: Ralph Boehme <slow at samba.org>
Date: Mon Aug 8 16:58:51 2016 +0200
dbwrap_ctdb: treat empty records in ltdb as non-existing
When fetching records from remote ctdb nodes via ctdbd_parse() or in
db_ctdb_traverse(), we already check for tombstone records and skip
them. This was originally also done for the ltdb checks.
See also bug: https://bugzilla.samba.org/show_bug.cgi?id=10008
(commit 1cae59ce112ccb51b45357a52b902f80fce1eef1).
Commit 925625b52886d40b50fc631bad8bdc81970f7598 reverted part of the
patch of bug 10008 due to a deadlock it introduced.
This patch re-introduces the consistent treatment of empty records in
the ltdb but avoids the deadlock by correctly signalling
NT_STATUS_NOT_FOUND if an empty record is found authoritatively in
the ltdb and not calling ctdb in this case.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12005
Pair-Programmed-With: Michael Adam <obnox at samba.org>
Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Tue Aug 9 04:38:44 CEST 2016 on sn-devel-144
(backported from commit 25df582739918b7afd4e5497eaffe279e2d92cd1)
Autobuild-User(v4-3-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-3-test): Wed Aug 10 14:58:12 CEST 2016 on sn-devel-104
commit f7718e4257da073c79b133d0075ea9bfa93f8030
Author: Ralph Boehme <slow at samba.org>
Date: Sat Jul 23 11:08:13 2016 +0200
s4/torture: add a test for ctdb-tombstrone-record deadlock
This tests for a possible deadlock between smbd and ctdb dealing with
ctdb tombstone records.
Commit 925625b52886d40b50fc631bad8bdc81970f7598 explains the deadlock in
more details and contains the fix. It's a fix for a regression
introduced by the patch for bug 10008 (1cae59ce112c).
If you ever want to use this test against that specific commit:
$ git checkout 925625b52886d40b50fc631bad8bdc81970f7598
$ git cherry-pick THIS_COMMIT
This should not deadlock on a ctdb cluster.
$ git revert 925625b52886d40b50fc631bad8bdc81970f7598
This will deadlock.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12005
Pair-Programmed-With: Michael Adam <obnox at samba.org>
Signed-off-by: Ralph Boehme <slow at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
(cherry picked from commit b17e2f5c740fb081c007ed2e1c23138ffcba1469)
commit dfa1254346d109e68cb4475375191c24d5b1b448
Author: Ralph Boehme <slow at samba.org>
Date: Wed Jul 20 12:36:24 2016 +0200
smbd: ignore ctdb tombstone records in fetch_share_mode_unlocked_parser()
dbwrap_parse_record() can return ctdb tombstone records from the lctdb,
ignore them.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12005
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 7147859c7afc1344e76485e2cbc286679110d96e)
commit 15bcc4a1f0ff5a48295143b1e3c556f8c60f3bfd
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 5 16:50:58 2016 +1000
ctdb-daemon: Fix CID 1125627 Resource leak (RESOURCE_LEAK)
Also fixes CID 1125628.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 940272d215049f5f5079aa926e69eae1985a4bfa)
commit 09cbfa6c9c87f864bb4b044e27dcbb944855aa22
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 5 16:39:50 2016 +1000
ctdb-common: Fix CID 1125585 Dereference after null check (FORWARD_NULL)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit b4f23a7e95cd9c8fc4a6324d4ec5a2881eaec207)
commit 07f729576d9ca4d0b40c8ffed91f5cdd065f0b1d
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 5 16:38:45 2016 +1000
ctdb-common: Fix CID 1125583 Dereference after null check (FORWARD_NULL)
This also fixes CID 1125584.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit bbf0b907cb04184515d0f5f09f14824df1c2e59f)
commit 49211ba72232909a4c44df7a3204dbb57b67fbe4
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Aug 5 16:37:00 2016 +1000
ctdb-common: Fix CID 1125581 Dereference after null check (FORWARD_NULL)
This also fixes CID 1125582.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 7ae3699831427725f12e0a26a0681e59f2fbb2d9)
commit 1f47aa8e6d49d05d90fa51c2bf3df9bc705ab976
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Jul 28 12:06:23 2016 +1000
ctdb-daemon: Fix CID 1363067 Resource leak (RESOURCE_LEAK)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit c6a7f680ce74d4a630fa9305d0a926cc1a4b3d2c)
commit 6e360805c0f8fc02ad826c11b3088ed11347bfd9
Author: Martin Schwenke <martin at meltin.net>
Date: Thu Jul 28 12:00:27 2016 +1000
ctdb-daemon: Fix CID 1363233 Resource leak (RESOURCE_LEAK)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 74aca5f4c671d9f15ae6c3a901978a1cf247dd6f)
commit 5a864c91e9d281d28559e56abfecce7b3bdece42
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jul 27 17:43:34 2016 +1000
ctdb-utils: Fix CID 1297451 Explicit null dereferenced (FORWARD_NULL)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit d46960f20e795cd4abc1c727705f77b2f0e0e564)
commit 1d3368124241cc143940b954b6c55a7f1291da46
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Aug 1 15:03:56 2016 +1000
ctdb-common: Consistently use strlcpy() on interface names
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit aff33a59479cafcb1f24a07ff76383d47bb196b3)
commit e5d0277072bcab696c7e583d5bb6d4e4bcfd9ee0
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jul 27 16:22:36 2016 +1000
ctdb-common: Fix CID 1125553 Buffer not null terminated (BUFFER_SIZE_WARNING)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 763f9c13f2998a8858e8a3ec013d166a3d429835)
commit 32b3c96fc8c6f03ad2ca89bb09a6414db98fce89
Author: Martin Schwenke <martin at meltin.net>
Date: Wed Jul 27 11:45:49 2016 +1000
ctdb-daemon: Fix CID 1364527/8/9: Null pointer dereferences (NULL_RETURNS)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12110
Signed-off-by: Martin Schwenke <martin at meltin.net>
Reviewed-by: Volker Lendecke <vl at samba.org>
(cherry picked from commit ed81e51cc1633cecfef05b84c0595418db8a384b)
-----------------------------------------------------------------------
Summary of changes:
ctdb/client/ctdb_client.c | 4 +++
ctdb/common/rb_tree.c | 6 ++--
ctdb/common/system_linux.c | 8 ++---
ctdb/server/ctdb_daemon.c | 4 +++
ctdb/server/ctdb_logging.c | 9 ++++--
ctdb/server/ctdb_recover.c | 2 ++
ctdb/server/ctdbd.c | 4 +++
ctdb/utils/ping_pong/ping_pong.c | 4 ++-
source3/lib/dbwrap/dbwrap_ctdb.c | 27 ++++++++++++++++-
source3/locking/share_mode_lock.c | 6 ++++
source4/torture/smb2/lock.c | 64 +++++++++++++++++++++++++++++++++++++++
11 files changed, 127 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index 7bffefe..906d418 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -4383,6 +4383,10 @@ int switch_from_server_to_client(struct ctdb_context *ctdb, const char *fmt, ...
/* get a new event context */
ctdb->ev = event_context_init(ctdb);
+ if (ctdb->ev == NULL) {
+ DEBUG(DEBUG_ALERT,("tevent_context_init() failed\n"));
+ exit(1);
+ }
tevent_loop_allow_nesting(ctdb->ev);
/* Connect to main CTDB daemon */
diff --git a/ctdb/common/rb_tree.c b/ctdb/common/rb_tree.c
index 6b131bc..18418f3 100644
--- a/ctdb/common/rb_tree.c
+++ b/ctdb/common/rb_tree.c
@@ -210,21 +210,21 @@ static inline int trbt_get_color_right(trbt_node_t *node)
/* setting a NULL node to black is a nop */
static inline void trbt_set_color(trbt_node_t *node, int color)
{
- if ( (node==NULL) && (color==TRBT_BLACK) ) {
+ if (node == NULL) {
return;
}
node->rb_color = color;
}
static inline void trbt_set_color_left(trbt_node_t *node, int color)
{
- if ( ((node==NULL)||(node->left==NULL)) && (color==TRBT_BLACK) ) {
+ if (node == NULL || node->left == NULL) {
return;
}
node->left->rb_color = color;
}
static inline void trbt_set_color_right(trbt_node_t *node, int color)
{
- if ( ((node==NULL)||(node->right==NULL)) && (color==TRBT_BLACK) ) {
+ if (node == NULL || node->right == NULL) {
return;
}
node->right->rb_color = color;
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index 9872070..5995cb2 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -108,7 +108,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
}
/* get the mac address */
- strncpy(if_hwaddr.ifr_name, iface, sizeof(if_hwaddr.ifr_name)-1);
+ strlcpy(if_hwaddr.ifr_name, iface, sizeof(if_hwaddr.ifr_name));
ret = ioctl(s, SIOCGIFHWADDR, &if_hwaddr);
if ( ret < 0 ) {
close(s);
@@ -194,7 +194,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
}
DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for sending arp\n", s));
- strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
+ strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
close(s);
@@ -202,7 +202,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
}
/* get the mac address */
- strncpy(if_hwaddr.ifr_name, iface, sizeof(if_hwaddr.ifr_name)-1);
+ strlcpy(if_hwaddr.ifr_name, iface, sizeof(if_hwaddr.ifr_name));
ret = ioctl(s, SIOCGIFHWADDR, &if_hwaddr);
if ( ret < 0 ) {
close(s);
@@ -575,7 +575,7 @@ bool ctdb_sys_check_iface_exists(const char *iface)
return true;
}
- strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)-1);
+ strlcpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFINDEX, &ifr) < 0 && errno == ENODEV) {
DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
close(s);
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index ac2db75..6d7edc2 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -1241,6 +1241,10 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
}
ctdb->ev = event_context_init(NULL);
+ if (ctdb->ev == NULL) {
+ DEBUG(DEBUG_ALERT,("tevent_context_init() failed\n"));
+ exit(1);
+ }
tevent_loop_allow_nesting(ctdb->ev);
tevent_set_trace_callback(ctdb->ev, ctdb_tevent_trace, ctdb);
ret = ctdb_init_tevent_logging(ctdb);
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 129bdc9..a72d8bf 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -269,9 +269,14 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb)
/* We'll fail if stderr/stdout not already open; it's simpler. */
old_stdout = dup(STDOUT_FILENO);
+ if (old_stdout < 0) {
+ DEBUG(DEBUG_ERR, ("Failed to dup stdout for child logging\n"));
+ return -1;
+ }
old_stderr = dup(STDERR_FILENO);
- if (old_stdout < 0 || old_stderr < 0) {
- DEBUG(DEBUG_ERR, ("Failed to dup stdout/stderr for child logging\n"));
+ if (old_stderr < 0) {
+ DEBUG(DEBUG_ERR, ("Failed to dup stderr for child logging\n"));
+ close(old_stdout);
return -1;
}
if (dup2(p[1], STDOUT_FILENO) < 0 || dup2(p[1], STDERR_FILENO) < 0) {
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 23f793b..1007f9c 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -1008,6 +1008,7 @@ int32_t ctdb_control_try_delete_records(struct ctdb_context *ctdb, TDB_DATA inda
if (data.dsize < sizeof(struct ctdb_ltdb_header)) {
DEBUG(DEBUG_CRIT,(__location__ " bad ltdb record in indata\n"));
+ talloc_free(records);
return -1;
}
@@ -1200,6 +1201,7 @@ int32_t ctdb_control_receive_records(struct ctdb_context *ctdb,
if (data.dsize < sizeof(struct ctdb_ltdb_header)) {
DEBUG(DEBUG_CRIT, (__location__ " bad ltdb record "
"in indata\n"));
+ talloc_free(records);
return -1;
}
diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c
index ec285c0..bb15ea3 100644
--- a/ctdb/server/ctdbd.c
+++ b/ctdb/server/ctdbd.c
@@ -164,6 +164,10 @@ int main(int argc, const char *argv[])
fault_setup();
ev = event_context_init(NULL);
+ if (ev == NULL) {
+ DEBUG(DEBUG_ALERT,("tevent_context_init() failed\n"));
+ exit(1);
+ }
tevent_loop_allow_nesting(ev);
ctdb = ctdb_cmdline_init(ev);
diff --git a/ctdb/utils/ping_pong/ping_pong.c b/ctdb/utils/ping_pong/ping_pong.c
index fdb575d..aec3ff0 100644
--- a/ctdb/utils/ping_pong/ping_pong.c
+++ b/ctdb/utils/ping_pong/ping_pong.c
@@ -141,7 +141,9 @@ static void ping_pong(int fd, int num_locks)
val = (unsigned char *)calloc(num_locks+1, sizeof(unsigned char));
if (val == NULL) {
printf("calloc failed\n");
- munmap(p, num_locks+1);
+ if (use_mmap) {
+ munmap(p, num_locks+1);
+ }
return;
}
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index f37bfd8..64cc7c7 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1213,6 +1213,7 @@ struct db_ctdb_parse_record_state {
void *private_data;
bool ask_for_readonly_copy;
bool done;
+ bool empty_record;
};
static void db_ctdb_parse_record_parser(
@@ -1232,7 +1233,16 @@ static void db_ctdb_parse_record_parser_nonpersistent(
(struct db_ctdb_parse_record_state *)private_data;
if (db_ctdb_can_use_local_hdr(header, true)) {
- state->parser(key, data, state->private_data);
+ /*
+ * A record consisting only of the ctdb header can be
+ * a validly created empty record or a tombstone
+ * record of a deleted record (not vacuumed yet). Mark
+ * it accordingly.
+ */
+ state->empty_record = (data.dsize == 0);
+ if (!state->empty_record) {
+ state->parser(key, data, state->private_data);
+ }
state->done = true;
} else {
/*
@@ -1257,6 +1267,7 @@ static NTSTATUS db_ctdb_parse_record(struct db_context *db, TDB_DATA key,
state.parser = parser;
state.private_data = private_data;
+ state.empty_record = false;
if (ctx->transaction != NULL) {
struct db_ctdb_transaction_handle *h = ctx->transaction;
@@ -1288,6 +1299,20 @@ static NTSTATUS db_ctdb_parse_record(struct db_context *db, TDB_DATA key,
status = db_ctdb_ltdb_parse(
ctx, key, db_ctdb_parse_record_parser_nonpersistent, &state);
if (NT_STATUS_IS_OK(status) && state.done) {
+ if (state.empty_record) {
+ /*
+ * We know authoritatively, that this is an empty
+ * record. Since ctdb does not distinguish between empty
+ * and deleted records, this can be a record stored as
+ * empty or a not-yet-vacuumed tombstone record of a
+ * deleted record. Now Samba right now can live without
+ * empty records, so we can safely report this record
+ * as non-existing.
+ *
+ * See bugs 10008 and 12005.
+ */
+ return NT_STATUS_NOT_FOUND;
+ }
return NT_STATUS_OK;
}
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 4e9de03..4503d5d 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -620,6 +620,12 @@ static void fetch_share_mode_unlocked_parser(
struct share_mode_lock *lck = talloc_get_type_abort(
private_data, struct share_mode_lock);
+ if (data.dsize == 0) {
+ /* Likely a ctdb tombstone record, ignore it */
+ lck->data = NULL;
+ return;
+ }
+
lck->data = parse_share_modes(lck, key, data);
}
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index 68e353d..3900abf 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -3033,6 +3033,69 @@ done:
return ret;
}
+/**
+ * Test lock interaction between smbd and ctdb with tombstone records.
+ *
+ * Re-locking an unlocked record could lead to a deadlock between
+ * smbd and ctdb. Make sure we don't regress.
+ *
+ * https://bugzilla.samba.org/show_bug.cgi?id=12005
+ * https://bugzilla.samba.org/show_bug.cgi?id=10008
+ */
+static bool test_deadlock(struct torture_context *torture,
+ struct smb2_tree *tree)
+{
+ NTSTATUS status;
+ bool ret = true;
+ struct smb2_handle _h;
+ struct smb2_handle *h = NULL;
+ uint8_t buf[200];
+ const char *fname = BASEDIR "\\deadlock.txt";
+
+ if (!lpcfg_clustering(torture->lp_ctx)) {
+ torture_skip(torture, "Test must be run on a ctdb cluster\n");
+ return true;
+ }
+
+ status = torture_smb2_testdir(tree, BASEDIR, &_h);
+ torture_assert_ntstatus_ok(torture, status,
+ "torture_smb2_testdir failed");
+ smb2_util_close(tree, _h);
+
+ status = torture_smb2_testfile(tree, fname, &_h);
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "torture_smb2_testfile failed");
+ h = &_h;
+
+ ZERO_STRUCT(buf);
+ status = smb2_util_write(tree, *h, buf, 0, ARRAY_SIZE(buf));
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "smb2_util_write failed");
+
+ status = test_smb2_lock(tree, *h, 0, 1, true);
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "test_smb2_lock failed");
+
+ status = test_smb2_unlock(tree, *h, 0, 1);
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "test_smb2_unlock failed");
+
+ status = test_smb2_lock(tree, *h, 0, 1, true);
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "test_smb2_lock failed");
+
+ status = test_smb2_unlock(tree, *h, 0, 1);
+ torture_assert_ntstatus_ok_goto(torture, status, ret, done,
+ "test_smb2_unlock failed");
+
+done:
+ if (h != NULL) {
+ smb2_util_close(tree, *h);
+ }
+ smb2_deltree(tree, BASEDIR);
+ return ret;
+}
+
/* basic testing of SMB2 locking
*/
struct torture_suite *torture_smb2_lock_init(void)
@@ -3068,6 +3131,7 @@ struct torture_suite *torture_smb2_lock_init(void)
torture_suite_add_2smb2_test(suite, "overlap", test_overlap);
torture_suite_add_1smb2_test(suite, "truncate", test_truncate);
torture_suite_add_1smb2_test(suite, "replay", test_replay);
+ torture_suite_add_1smb2_test(suite, "ctdb-delrec-deadlock", test_deadlock);
suite->description = talloc_strdup(suite, "SMB2-LOCK tests");
--
Samba Shared Repository
More information about the samba-cvs
mailing list