The idea of the optimisation is to avoid expensive db queries in locking.tdb if we *know* we're the only open. The code uses EXCLUSIVE_OPLOCK_TYPE which doesn't cover leases. Have patch, need bugnumber. This is the bug I talked about at SambaXP, spotted with perf.
Created attachment 13195 [details] Patch for 4.5 and 4.6 cherry-picked from master
Re-assigning to Karolin for inclusion in 4.6.next, 4.5.next.
(In reply to Jeremy Allison from comment #2) Pushed autobuild-v4-{6,5}-test.
(In reply to Karolin Seeger from comment #3) Pushed to both branches. Closing out bug report. Thanks!
*** Bug 12798 has been marked as a duplicate of this bug. ***