[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Fri Jan 21 04:30:02 MST 2011
The branch, master has been updated
via 1b373d6 s3: Fix a deadlock between smbd and ctdbd
from 8db3258 s3-spoolss: make it more obvious what winreg_create_printer() does.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 1b373d6044e56f3678c42dae2c03825ef761cabc
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 21 10:30:13 2011 +0100
s3: Fix a deadlock between smbd and ctdbd
Do the notification after we released the share mode lock. Inside notify_fname
we take out another tdb lock. With ctdb also accessing our databases, this can
lead to deadlocks. Putting this notify after the TALLOC_FREE(lck) above we
avoid locking two records simultaneously. Notifies are async and informational
only, so calling the notify_fname without holding the share mode lock should
not do any harm.
Autobuild-User: Volker Lendecke <vlendec at samba.org>
Autobuild-Date: Fri Jan 21 12:29:21 CET 2011 on sn-devel-104
-----------------------------------------------------------------------
Summary of changes:
source3/smbd/close.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 00bcef0..a6610e5 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -473,10 +473,6 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
status = map_nt_error_from_unix(errno);
}
- notify_fname(conn, NOTIFY_ACTION_REMOVED,
- FILE_NOTIFY_CHANGE_FILE_NAME,
- fsp->fsp_name->base_name);
-
/* As we now have POSIX opens which can unlink
* with other open files we may have taken
* this code path with more than one share mode
@@ -495,6 +491,24 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
}
TALLOC_FREE(lck);
+
+ if (delete_file) {
+ /*
+ * Do the notification after we released the share
+ * mode lock. Inside notify_fname we take out another
+ * tdb lock. With ctdb also accessing our databases,
+ * this can lead to deadlocks. Putting this notify
+ * after the TALLOC_FREE(lck) above we avoid locking
+ * two records simultaneously. Notifies are async and
+ * informational only, so calling the notify_fname
+ * without holding the share mode lock should not do
+ * any harm.
+ */
+ notify_fname(conn, NOTIFY_ACTION_REMOVED,
+ FILE_NOTIFY_CHANGE_FILE_NAME,
+ fsp->fsp_name->base_name);
+ }
+
return status;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list