The Samba-Bugzilla – Attachment 13771 Details for
Bug 13058
Kernel oplock can remain not broken if oplock holder closes the file and another process catches the lease.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.6.next
bug-13130-4.6.patch (text/plain), 2.06 KB, created by
Jeremy Allison
on 2017-11-11 04:03:12 UTC
(
hide
)
Description:
git-am fix for 4.6.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-11-11 04:03:12 UTC
Size:
2.06 KB
patch
obsolete
>From 3fa5c8cb248348d9eae5b870e33e81417e0ba06a Mon Sep 17 00:00:00 2001 >From: Volker Lendecke <vl@samba.org> >Date: Fri, 10 Nov 2017 21:22:26 +0100 >Subject: [PATCH] tevent: Fix a race condition > >We can't rely on tctx to exist after we unlocked the mutex. It took a >while, but this does lead to data corruption. If *tctx is replaced with >something where tctx->wakeup_fd points to a real, existing file >descriptor, we're screwed. And by screwed, this means file corruption >on disk. > >Again. I am not tall enough for this business. > >http://bholley.net/blog/2015/must-be-this-tall-to-write-multi-threaded-code.html > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13130 > >Signed-off-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Sat Nov 11 03:20:09 CET 2017 on sn-devel-144 > >(cherry picked from commit 20cfcb7dbc5dd099384b76a76e3d35cf627100b6) >--- > lib/tevent/tevent_threads.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/lib/tevent/tevent_threads.c b/lib/tevent/tevent_threads.c >index 8197323af02..197ad1dfe41 100644 >--- a/lib/tevent/tevent_threads.c >+++ b/lib/tevent/tevent_threads.c >@@ -434,7 +434,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx, > { > #ifdef HAVE_PTHREAD > struct tevent_context *ev; >- int ret; >+ int ret, wakeup_fd; > > ret = pthread_mutex_lock(&tctx->event_ctx_mutex); > if (ret != 0) { >@@ -442,6 +442,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx, > } > > ev = tctx->event_ctx; >+ wakeup_fd = tctx->wakeup_fd; > > ret = pthread_mutex_unlock(&tctx->event_ctx_mutex); > if (ret != 0) { >@@ -489,7 +490,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx, > * than a noncontended one. So I'd opt for the lower footprint > * initially. Maybe we have to change that later. > */ >- tevent_common_wakeup_fd(tctx->wakeup_fd); >+ tevent_common_wakeup_fd(wakeup_fd); > #else > /* > * tevent_threaded_context_create() returned NULL with ENOSYS... >-- >2.14.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
slow
:
review-
Actions:
View
Attachments on
bug 13058
:
13639
|
13742
|
13764
|
13770
|
13771
|
13772
|
13773