I have two shares, one with "kernel oplocks = Yes", and another one with "kernel oplocks = No". When server establishes connection with the 1st share, smbd sets sconn->oplocks.kernel_ops in make_connection_snum(). Then, when samba opens file on a 2nd share, it may call set_file_oplock(oplock=0x2), but linux_set_kernel_oplock is not called, because kernel oplocks = No. But when file is closed, release_file_oplock checks only if sconn->oplocks.kernel_ops is set, but not "kernel oplocks" flag, and calls linux_release_kernel_oplock, that returns EAGAIN: Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: [2015/06/22 15:02:55.886428, 0, pid=3752, class=locking] ../source3/smbd/oplock_linux.c:184(linux_release_kernel_oplock) Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: linux_release_kernel_oplock: Error when removing kernel oplock on file Automation/Phase 3/Reports/Aspire16/Collections/2014/01_January/140122 Aspire16 Collections.xls, file_id = 20fc15:1413b2d:0, gen_id = 2055499866. Error was Resource temporarily unavailable Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: [2015/06/22 15:02:55.902226, 0, pid=3752, class=locking] ../source3/smbd/oplock_linux.c:184(linux_release_kernel_oplock) Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: linux_release_kernel_oplock: Error when removing kernel oplock on file Automation/Phase 3/Reports/Aspire16/Collections/2014/01_January/140123 Aspire16 Collections.xls, file_id = 20fc15:1413b2e:0, gen_id = 884879534. Error was Resource temporarily unavailable Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: [2015/06/22 15:02:55.918325, 0, pid=3752, class=locking] ../source3/smbd/oplock_linux.c:184(linux_release_kernel_oplock) Jun 22 15:02:55 vsa-000004a5-vc-1 smbd[3752]: linux_release_kernel_oplock: Error when removing kernel oplock on file Automation/Phase 3/Reports/Aspire16/Collections/2014/01_January/140127 Aspire16 Collections.xls, file_id = 20fc15:1413b2f:0, gen_id = 993100754. Error was Resource temporarily unavailable
Created attachment 11756 [details] possible patch This patch might fix the problem. Can you give it a try?
Yes, looks good. -Lev.
Comment on attachment 11756 [details] possible patch LGTM. Pushed to master ! Jeremy.
Created attachment 11759 [details] Patch for 4.3.x and 4.2.x with cherry-pick information Thx for the review. Here is the patch with cherry pick information to get it into 4.3.x and 4.2.x
Comment on attachment 11759 [details] Patch for 4.3.x and 4.2.x with cherry-pick information LGTM.
Reassigning to Karolin for inclusion in 4.3.next, 4.2.next.
(In reply to Jeremy Allison from comment #6) Pushed to autobuild-v4-[2|3]-test.
(In reply to Karolin Seeger from comment #7) Pushed to both branches. Closing out bug report. Thanks!