summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-12-28 22:31:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:56 -0500
commit06c454094fc4cba0d19262e57b79596d066f9ce2 (patch)
treebd490eadd946a45f35d9a574157429ed68fca7fd
parent020cd6b95bd46f5c51d77558fcac6567998ee364 (diff)
downloadsamba-06c454094fc4cba0d19262e57b79596d066f9ce2.tar.gz
samba-06c454094fc4cba0d19262e57b79596d066f9ce2.tar.bz2
samba-06c454094fc4cba0d19262e57b79596d066f9ce2.zip
r12551: fixed oplock serialisation problem in gentest as well
(This used to be commit 2055f978214c1a2732433efe38ebc0fb70ec4e70)
-rw-r--r--source4/torture/gentest.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index abd9921569..d466671252 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -708,6 +708,16 @@ static void async_notify(struct smbcli_request *req)
}
}
+static void oplock_handler_close_recv(struct smbcli_request *req)
+{
+ NTSTATUS status;
+ status = smbcli_request_simple_recv(req);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("close failed in oplock_handler\n");
+ smb_panic("close failed in oplock_handler");
+ }
+}
+
/*
the oplock handler will either ack the break or close the file
*/
@@ -718,6 +728,7 @@ static BOOL oplock_handler(struct smbcli_transport *transport, uint16_t tid, uin
int i, j;
BOOL do_close;
struct smbcli_tree *tree = NULL;
+ struct smbcli_request *req;
srandom(current_op.seed);
do_close = gen_chance(50);
@@ -751,11 +762,17 @@ static BOOL oplock_handler(struct smbcli_transport *transport, uint16_t tid, uin
io.close.level = RAW_CLOSE_CLOSE;
io.close.in.fnum = fnum;
io.close.in.write_time = 0;
- status = smb_raw_close(tree, &io);
+ req = smb_raw_close_send(tree, &io);
- if (!NT_STATUS_IS_OK(status)) {
- printf("WARNING: close failed in oplock_handler_close - %s\n", nt_errstr(status));
+ if (req == NULL) {
+ printf("WARNING: close failed in oplock_handler_close - %s\n",
+ nt_errstr(status));
+ return False;
}
+
+ req->async.fn = oplock_handler_close_recv;
+ req->async.private = NULL;
+
return True;
}