fixed the handling of level II oplocks in samba4, especially when
authorAndrew Tridgell <tridge@samba.org>
Thu, 25 Mar 2004 02:41:19 +0000 (02:41 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 25 Mar 2004 02:41:19 +0000 (02:41 +0000)
acting as a cifs redirectory (using the cifs backend)

source/libcli/raw/clioplock.c
source/libcli/raw/rawrequest.c
source/smb_server/smb_server.c
source/torture/gentest.c
source/torture/raw/oplock.c

index 8f69716bda455f972c1e560c2cd1daf1a0bd6bed..f27bf937ce505f7cdd7f9a030f97888ee3254bc9 100644 (file)
@@ -33,7 +33,8 @@ BOOL cli_oplock_ack(struct cli_tree *tree, uint16 fnum, uint16 ack_level)
        SSVAL(req->out.vwv,VWV(0),0xFF);
        SSVAL(req->out.vwv,VWV(1),0);
        SSVAL(req->out.vwv,VWV(2),fnum);
-       SSVAL(req->out.vwv,VWV(3),ack_level);
+       SCVAL(req->out.vwv,VWV(3),LOCKING_ANDX_OPLOCK_RELEASE);
+       SCVAL(req->out.vwv,VWV(3)+1,ack_level);
        SIVAL(req->out.vwv,VWV(4),0);
        SSVAL(req->out.vwv,VWV(6),0);
        SSVAL(req->out.vwv,VWV(7),0);
index 2b84345abb1d6ded1c37e5df435bc1382b0290ee..f03cc5cf16a30e0c855bedc0429c109c2249d4fe 100644 (file)
@@ -340,7 +340,7 @@ static BOOL handle_oplock_break(struct cli_transport *transport, uint_t len, con
        if (transport->oplock.handler) {
                uint16 tid = SVAL(hdr, HDR_TID);
                uint16 fnum = SVAL(vwv,VWV(2));
-               uint8 level = CVAL(vwv,VWV(3));
+               uint8 level = CVAL(vwv,VWV(3)+1);
                transport->oplock.handler(transport, tid, fnum, level, transport->oplock.private);
        }
 
index 8769a6f3f13449d1e68cbeb46aa987cc80b8afa0..f798accc3f0287a79ecb948c6b9b43efad8f7e40 100644 (file)
@@ -44,7 +44,8 @@ BOOL req_send_oplock_break(struct tcon_context *conn, uint16 fnum, uint8 level)
        SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE);
        SSVAL(req->out.vwv, VWV(1), 0);
        SSVAL(req->out.vwv, VWV(2), fnum);
-       SSVAL(req->out.vwv, VWV(3), level);
+       SCVAL(req->out.vwv, VWV(3), LOCKING_ANDX_OPLOCK_RELEASE);
+       SCVAL(req->out.vwv, VWV(3)+1, level);
        SIVAL(req->out.vwv, VWV(4), 0);
        SSVAL(req->out.vwv, VWV(6), 0);
        SSVAL(req->out.vwv, VWV(7), 0);
index 03a66487fa7413e64473130208929277ae5d2380..32dd763b26df588206afea27a1c1ea8d856b9eb5 100644 (file)
@@ -736,7 +736,7 @@ static BOOL oplock_handler(struct cli_transport *transport, uint16 tid, uint16 f
 
        if (!do_close) {
                printf("oplock ack fnum=%d\n", fnum);
-               return cli_oplock_ack(tree, fnum, level == 1? 0x102 : 2);
+               return cli_oplock_ack(tree, fnum, level);
        }
 
        printf("oplock close fnum=%d\n", fnum);
index dc8c883f769cd9410a81ab50b39c0e87e281be7c..0eabcc94f7cbb540d9f6a4181ba102556509a82b 100644 (file)
@@ -54,7 +54,7 @@ static BOOL oplock_handler_ack(struct cli_transport *transport, uint16 tid, uint
 
        printf("Acking in oplock handler\n");
 
-       return cli_oplock_ack(tree, fnum, level == 1? 0x102 : 2);
+       return cli_oplock_ack(tree, fnum, level);
 }
 
 /*