From 895b99fd6bfb1a65c3ae408bdf381e66783ac385 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 13 May 2010 11:33:02 -0700 Subject: Be more forgiving on client oplock break failure (as Windows does). Remove a global. Jeremy. --- source3/modules/onefs_open.c | 2 +- source3/smbd/globals.c | 1 - source3/smbd/globals.h | 1 - source3/smbd/open.c | 2 +- source3/smbd/oplock.c | 4 ---- source3/smbd/oplock_onefs.c | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) (limited to 'source3') diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c index f7d6e0700f..ac3c5b2024 100644 --- a/source3/modules/onefs_open.c +++ b/source3/modules/onefs_open.c @@ -591,7 +591,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn, } /* Ignore oplock requests if oplocks are disabled. */ - if (!lp_oplocks(SNUM(conn)) || global_client_failed_oplock_break || + if (!lp_oplocks(SNUM(conn)) || IS_VETO_OPLOCK_PATH(conn, smb_fname->base_name)) { /* Mask off everything except the private Samba bits. */ oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK; diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c index 38ba1a4d79..10ee5e81e2 100644 --- a/source3/smbd/globals.c +++ b/source3/smbd/globals.c @@ -112,7 +112,6 @@ char *sparse_buf = NULL; /* Current number of oplocks we have outstanding. */ int32_t exclusive_oplocks_open = 0; int32_t level_II_oplocks_open = 0; -bool global_client_failed_oplock_break = false; struct kernel_oplocks *koplocks = NULL; int am_parent = 1; diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 113e343c3e..ad175bc420 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -122,7 +122,6 @@ extern char *sparse_buf; /* Current number of oplocks we have outstanding. */ extern int32_t exclusive_oplocks_open; extern int32_t level_II_oplocks_open; -extern bool global_client_failed_oplock_break; extern struct kernel_oplocks *koplocks; extern int am_parent; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 049ce222ad..ce69157df5 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1593,7 +1593,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, } /* ignore any oplock requests if oplocks are disabled */ - if (!lp_oplocks(SNUM(conn)) || global_client_failed_oplock_break || + if (!lp_oplocks(SNUM(conn)) || IS_VETO_OPLOCK_PATH(conn, smb_fname->base_name)) { /* Mask off everything except the private Samba bits. */ oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK; diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 1ff1737a3f..a6702a5595 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -320,10 +320,6 @@ static void oplock_timeout_handler(struct event_context *ctx, TALLOC_FREE(fsp->oplock_timeout); DEBUG(0, ("Oplock break failed for file %s -- replying anyway\n", fsp_str_dbg(fsp))); - /* Only set this for SMB1.. */ - if (!smbd_server_conn->allow_smb2) { - global_client_failed_oplock_break = True; - } remove_oplock(fsp); reply_to_oplock_break_requests(fsp); } diff --git a/source3/smbd/oplock_onefs.c b/source3/smbd/oplock_onefs.c index 3811211088..9c6287ba34 100644 --- a/source3/smbd/oplock_onefs.c +++ b/source3/smbd/oplock_onefs.c @@ -380,7 +380,6 @@ static void oplock_revoked_handler(uint64_t id) DEBUG(0,("Level 1 oplock break failed for file %s. Forcefully " "revoking oplock\n", fsp_str_dbg(fsp))); - global_client_failed_oplock_break = True; remove_oplock(fsp); /* -- cgit