diff options
author | Volker Lendecke <vl@samba.org> | 2013-10-16 21:21:56 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-10-23 12:05:43 +0200 |
commit | 6c3b41cfc24fca4a1786604102d1163d2fc0a20c (patch) | |
tree | e621818978b47465af850d5cbf1c4143dff60a21 | |
parent | 64e734019f5d0691017a592e78e6cac793875e4a (diff) | |
download | samba-6c3b41cfc24fca4a1786604102d1163d2fc0a20c.tar.gz samba-6c3b41cfc24fca4a1786604102d1163d2fc0a20c.tar.bz2 samba-6c3b41cfc24fca4a1786604102d1163d2fc0a20c.zip |
smbd: Fix breaking level2 on OVERWRITE create_disposition
This is shown by the new raw.oplock.level_ii_1 test
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | selftest/knownfail | 1 | ||||
-rw-r--r-- | source3/smbd/open.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/selftest/knownfail b/selftest/knownfail index 25289d2850..ab6d45fa5b 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -61,7 +61,6 @@ ^samba3.raw.acls nfs4acl_xattr-special.inheritance\(s3dc\) ^samba3.raw.acls nfs4acl_xattr-special.inherit_creator_owner\(s3dc\) ^samba3.raw.acls nfs4acl_xattr-special.inherit_creator_group\(s3dc\) -^samba3.raw.oplock.level_ii_1 ^samba3.base.delete.deltest16a ^samba3.base.delete.deltest17a ^samba3.unix.whoami anonymous connection.whoami\(plugin_s4_dc\) # We need to resolve if we should be including SID_NT_WORLD and SID_NT_NETWORK in this token diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 494145397d..c33a4cf357 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1372,6 +1372,17 @@ static bool delay_for_oplock(files_struct *fsp, */ return false; } + if (LEVEL_II_OPLOCK_TYPE(entry->op_type) && + (break_to == NO_OPLOCK)) { + if (share_mode_stale_pid(d, 0)) { + return false; + } + DEBUG(10, ("Asynchronously breaking level2 oplock for " + "create_disposition=%u\n", + (unsigned)create_disposition)); + send_break_message(fsp->conn->sconn->msg_ctx, entry, break_to); + return false; + } if (!EXCLUSIVE_OPLOCK_TYPE(entry->op_type)) { /* * No break for NO_OPLOCK or LEVEL2_OPLOCK oplocks |