The Samba-Bugzilla – Attachment 1848 Details for
Bug 3569
smbd hangs and spins on locking.tdb - requires smbd restart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (based on your code).
look (text/plain), 2.58 KB, created by
Jeremy Allison
on 2006-04-06 17:21:41 UTC
(
hide
)
Description:
Patch (based on your code).
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2006-04-06 17:21:41 UTC
Size:
2.58 KB
patch
obsolete
>Index: smbd/server.c >=================================================================== >--- smbd/server.c (revision 14953) >+++ smbd/server.c (working copy) >@@ -474,7 +474,7 @@ > > set_need_random_reseed(); > /* tdb needs special fork handling - remove CLEAR_IF_FIRST flags */ >- if (tdb_reopen_all() == -1) { >+ if (tdb_reopen_all(1) == -1) { > DEBUG(0,("tdb_reopen_all failed.\n")); > smb_panic("tdb_reopen_all failed."); > } >Index: nsswitch/winbindd_dual.c >=================================================================== >--- nsswitch/winbindd_dual.c (revision 14953) >+++ nsswitch/winbindd_dual.c (working copy) >@@ -629,7 +629,7 @@ > close(fdpair[1]); > > /* tdb needs special fork handling */ >- if (tdb_reopen_all() == -1) { >+ if (tdb_reopen_all(1) == -1) { > DEBUG(0,("tdb_reopen_all failed.\n")); > _exit(0); > } >Index: tdb/tdbtorture.c >=================================================================== >--- tdb/tdbtorture.c (revision 14953) >+++ tdb/tdbtorture.c (working copy) >@@ -103,7 +103,7 @@ > > #if REOPEN_PROB > if (random() % REOPEN_PROB == 0) { >- tdb_reopen_all(); >+ tdb_reopen_all(1); > goto next; > } > #endif >@@ -192,7 +192,7 @@ > for (i=0;i<NPROC;i++) { > pids[i] = fork(); > if (pids[i] == 0) { >- tdb_reopen_all(); >+ tdb_reopen_all(1); > > tdb_logging_function(db, tdb_log); > >Index: tdb/tdb.c >=================================================================== >--- tdb/tdb.c (revision 14953) >+++ tdb/tdb.c (working copy) >@@ -2098,11 +2098,27 @@ > } > > /* reopen all tdb's */ >-int tdb_reopen_all(void) >+int tdb_reopen_all(int parent_longlived) > { > TDB_CONTEXT *tdb; > > for (tdb=tdbs; tdb; tdb = tdb->next) { >+ /* >+ * If the parent is longlived (ie. a >+ * parent daemon architecture), we know >+ * it will keep it's active lock on a >+ * tdb opened with CLEAR_IF_FIRST. Thus >+ * for child processes we don't have to >+ * add an active lock. This is essential >+ * to improve performance on systems that >+ * keep POSIX locks as a non-scalable data >+ * structure in the kernel. >+ */ >+ if (parent_longlived) { >+ /* Ensure no clear-if-first. */ >+ tdb->flags &= ~TDB_CLEAR_IF_FIRST; >+ } >+ > if (tdb_reopen(tdb) != 0) > return -1; > } >Index: tdb/tdb.h >=================================================================== >--- tdb/tdb.h (revision 14953) >+++ tdb/tdb.h (working copy) >@@ -128,7 +128,7 @@ > tdb_hash_func hash_fn); > > int tdb_reopen(TDB_CONTEXT *tdb); >-int tdb_reopen_all(void); >+int tdb_reopen_all(int); > void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func); > enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb); > const char *tdb_errorstr(TDB_CONTEXT *tdb);
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 3569
:
1847
| 1848