The Samba-Bugzilla – Attachment 16555 Details for
Bug 14291
Patches for TDB mutex init problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Handle EBUSY from pthread_mutex_init & mutexattr_t initialization
tdb_mutex_init.patch (text/plain), 1.91 KB, created by
Peter Eriksson
on 2021-03-17 19:51:20 UTC
(
hide
)
Description:
Handle EBUSY from pthread_mutex_init & mutexattr_t initialization
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2021-03-17 19:51:20 UTC
Size:
1.91 KB
patch
obsolete
>--- samba-4.14.0-orig/lib/tdb/common/mutex.c tors jan. 21 14:20:40 2021 >+++ samba-4.14.0/lib/tdb/common/mutex.c ons mars 17 19:56:17 2021 >@@ -558,12 +558,13 @@ > int tdb_mutex_init(struct tdb_context *tdb) > { > struct tdb_mutexes *m; >- pthread_mutexattr_t ma; >+ pthread_mutexattr_t ma = { 0 }; /* Due to a bug in Illumos this needs to be zeroed - doesn't hurt anyone else */ > uint32_t i; > int ret; > > ret = tdb_mutex_mmap(tdb); > if (ret == -1) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_mutex_mmap failed: %s\n", strerror(errno))); > return -1; > } > m = tdb->mutexes; >@@ -570,18 +571,22 @@ > > ret = pthread_mutexattr_init(&ma); > if (ret != 0) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutexattr_init failed: %s\n", strerror(ret))); > goto fail_munmap; > } > ret = pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ERRORCHECK); > if (ret != 0) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutexattr_settype failed: %s\n", strerror(ret))); > goto fail; > } > ret = pthread_mutexattr_setpshared(&ma, PTHREAD_PROCESS_SHARED); > if (ret != 0) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutexattr_setpshared failed: %s\n", strerror(ret))); > goto fail; > } > ret = pthread_mutexattr_setrobust(&ma, PTHREAD_MUTEX_ROBUST); > if (ret != 0) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutexattr_setrobust failed: %s\n", strerror(ret))); > goto fail; > } > >@@ -589,7 +594,8 @@ > pthread_mutex_t *chain = &m->hashchains[i]; > > ret = pthread_mutex_init(chain, &ma); >- if (ret != 0) { >+ if (ret != 0 && ret != EBUSY) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutex_init(&m->hashchains[%d]) failed: %s\n", i, strerror(ret))); > goto fail; > } > } >@@ -597,7 +603,8 @@ > m->allrecord_lock = F_UNLCK; > > ret = pthread_mutex_init(&m->allrecord_mutex, &ma); >- if (ret != 0) { >+ if (ret != 0 && ret != EBUSY) { >+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "pthread_mutex_init(&m->allrecord_mutex) failed: %s\n", strerror(ret))); > goto fail; > } > ret = 0;
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
Actions:
View
Attachments on
bug 14291
:
15815
| 16555 |
16556