summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-27 09:40:49 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-27 16:33:13 +0100
commit32061705cffc98753975952f67aaa2a43e3eafb8 (patch)
tree30ee921f1fb38e4334aa1dd496b37a1bc7adbc83
parent3df754a7a8962929c27c1f9e0b8bb20756b0cfa7 (diff)
downloadsamba-32061705cffc98753975952f67aaa2a43e3eafb8.tar.gz
samba-32061705cffc98753975952f67aaa2a43e3eafb8.tar.bz2
samba-32061705cffc98753975952f67aaa2a43e3eafb8.zip
opendb_tdb: EXCLUSIVE oplock use the same matching logic
metze (This used to be commit 48e703d5a6b8a7b273d0bf15fc6198ef25b0a7c4)
-rw-r--r--source4/ntvfs/common/opendb_tdb.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c
index fe5a0a8864..a51c823a63 100644
--- a/source4/ntvfs/common/opendb_tdb.c
+++ b/source4/ntvfs/common/opendb_tdb.c
@@ -376,8 +376,26 @@ static NTSTATUS odb_tdb_open_can_internal(struct odb_context *odb,
exclusive oplocks afterwards. */
for (i=0;i<file->num_entries;i++) {
if (file->entries[i].oplock_level == OPLOCK_EXCLUSIVE) {
+ bool oplock_return = OPLOCK_BREAK_TO_LEVEL_II;
+ /* if this is an attribute only access
+ * it doesn't conflict with an EXCLUSIVE oplock
+ * but we'll not grant the oplock below
+ */
+ attrs_only = access_attributes_only(access_mask,
+ open_disposition,
+ break_to_none);
+ if (attrs_only) {
+ break;
+ }
+ /*
+ * send an oplock break to the holder of the
+ * oplock and tell caller to retry later
+ */
+ if (break_to_none) {
+ oplock_return = OPLOCK_BREAK_TO_NONE;
+ }
odb_oplock_break_send(odb, &file->entries[i],
- OPLOCK_BREAK_TO_NONE);
+ oplock_return);
return NT_STATUS_OPLOCK_NOT_GRANTED;
}
}
@@ -449,8 +467,8 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck,
e.oplock_level = OPLOCK_EXCLUSIVE;
*oplock_granted = EXCLUSIVE_OPLOCK_RETURN;
} else {
- e.oplock_level = OPLOCK_NONE;
- *oplock_granted = NO_OPLOCK_RETURN;
+ e.oplock_level = OPLOCK_LEVEL_II;
+ *oplock_granted = LEVEL_II_OPLOCK_RETURN;
}
} else if (oplock_level == OPLOCK_BATCH) {
if (file.num_entries == 0) {