diff options
Diffstat (limited to 'source4/ntvfs/common/opendb_tdb.c')
-rw-r--r-- | source4/ntvfs/common/opendb_tdb.c | 24 |
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) { |