Bug 4291 - change notify timeout block connection when setting to 0
change notify timeout block connection when setting to 0
Status: NEW
Product: Samba 3.0
Classification: Unclassified
Component: File Services
Other Windows XP
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2006-12-08 16:40 UTC by Ying Li
Modified: 2006-12-08 16:40 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ying Li 2006-12-08 16:40:06 UTC
We run into the problem with change notify timeout on 3.0.22. When the option is set to 0, mapping to share won't work at all on HPUX. 

I saw recent Jeremy's fix about change notify timeout that allows to be set to 0, per share at http://marc.theaimsgroup.com/?l=samba-cvs&m=114747546415800&w=2. It looks the fix won't help us to resolve connection issue.

I noticed there might be a possible issue in setup_change_notify() call. It looks like this call is a little bit confused to use change_notify_timeout to control smbd select_timeout. When the option is assigned to to in smb.conf, change_notify_timeout() returns 0. folloingup checking decides if to update existing select_timeout. But it only checks -1. Don't check 0. If I'm right, when t=0, select_timeout would be 0 too, and as a final result to pass to select_timeout in smbd_process(). When select_timeout=0, timeout_process would be drived. So this would block connections. I think setup_change_notify should check 0 by using "if (t > 0)", instead of "if (t !=-1). This way works to me, make connection OK.

I searched Buggzilla, not found similar issue. So it's worth to mention here. If I'm wrong, please point to me. We need a right fix for the issue.

static int setup_select_timeout(void)
	int select_timeout;
	int t;

	select_timeout = blocking_locks_timeout_ms(SMBD_SELECT_TIMEOUT*1000);

	t = change_notify_timeout();
	DEBUG(10, ("change_notify_timeout: %d\n", t));
	if (t != -1) {               <=================???
		select_timeout = MIN(select_timeout, t*1000);

	if (print_notify_messages_pending()) {
		select_timeout = MIN(select_timeout, 1000);

	return select_timeout;