best strategy for preventing unnecessary oplock breaks on doubly open files

tridge at samba.org tridge at samba.org
Wed Oct 12 01:45:18 GMT 2005


Jeremy,

 > Ok, do we know what the data on the wire should look like ? The
 > only reason for not doing so would be if we can't figure out what
 > the actual bits should be (although it looks pretty simple - can't
 > see that they need any really).

See the patch below that adds a test case for this to Samba4
smbtorture. It's just the same as the FSCTL_SET_SPARSE call with a
difference function number.

Cheers, Tridge


Index: torture/raw/ioctl.c
===================================================================
--- torture/raw/ioctl.c	(revision 10911)
+++ torture/raw/ioctl.c	(working copy)
@@ -105,6 +105,17 @@
 	status = smb_raw_ioctl(cli->tree, mem_ctx, &nt);
 	CHECK_STATUS(status, NT_STATUS_OK);
 
+	printf("trying batch oplock\n");
+	nt.ioctl.level = RAW_IOCTL_NTIOCTL;
+	nt.ntioctl.in.function = (FSCTL_FILESYSTEM | (2<<2));
+	nt.ntioctl.in.fnum = fnum;
+	nt.ntioctl.in.fsctl = True;
+	nt.ntioctl.in.filter = 0;
+
+	status = smb_raw_ioctl(cli->tree, mem_ctx, &nt);
+	CHECK_STATUS(status, NT_STATUS_OK);
+
+
  	printf("Trying bad handle\n");
 	nt.ntioctl.in.fnum = fnum+1;
 	status = smb_raw_ioctl(cli->tree, mem_ctx, &nt);


More information about the samba-technical mailing list