From: Ralph Boehme Date: Sun, 31 Aug 2025 11:40:27 +0000 (+0200) Subject: smbd: tweak process_oplock_break_message() to support saved lease breaks X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=381512cba1307f4f93a4e0606c9f73e88bf5ca37;p=thirdparty%2Fsamba.git smbd: tweak process_oplock_break_message() to support saved lease breaks Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/smb2_oplock.c b/source3/smbd/smb2_oplock.c index dc7565e706c..fa07a9bf6ed 100644 --- a/source3/smbd/smb2_oplock.c +++ b/source3/smbd/smb2_oplock.c @@ -953,7 +953,20 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx, break_from = current_state; break_to &= current_state; - if (breaking) { + if (breaking && (breaking_to_requested == current_state)) { + /* + * A "saved" oplock break stored by + * delay_for_oplock_fn() when breaking the lease of a + * disconnected Persistent Handle and dispatched by + * SMB_VFS_RECONNECT(). + */ + SMB_ASSERT(fsp->op->global->persistent); + breaking = true; + breaking_to_required = break_to; + breaking_to_requested = break_to; + /* Need to increment the epoch */ + epoch += 1; + } else if (breaking) { break_to &= breaking_to_required; if (breaking_to_required != break_to) { /*