diff options
author | Jeremy Allison <jra@samba.org> | 2009-10-26 21:20:22 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-10-26 21:20:22 -0700 |
commit | 9a2112ec6604bb9d2c9cf9a99ee42e3e19d209db (patch) | |
tree | 836a6ba78160678ce49dbeb63d7b62fae00f6000 /source3/smbd | |
parent | ab4d06909498c2fa7b22e6abcf7705aa807d0bf4 (diff) | |
download | samba-9a2112ec6604bb9d2c9cf9a99ee42e3e19d209db.tar.gz samba-9a2112ec6604bb9d2c9cf9a99ee42e3e19d209db.tar.bz2 samba-9a2112ec6604bb9d2c9cf9a99ee42e3e19d209db.zip |
Second part of the fix for bug 6828 - infinite timeout occurs when byte lock held outside of samba.
Fixes case where a connection with a pending lock can me marked "idle", and ensures
that the lock queue timeout is always recalculated.
Jeremy.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/blocking.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 01d9ca8105..deb7f8f221 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -652,7 +652,6 @@ void process_blocking_lock_queue(void) { struct timeval tv_curr = timeval_current(); struct blocking_lock_record *blr, *next = NULL; - bool recalc_timeout = False; /* * Go through the queue and see if we can get any of the locks. @@ -670,6 +669,14 @@ void process_blocking_lock_queue(void) DEBUG(10, ("Processing BLR = %p\n", blr)); + /* We use set_current_service so connections with + * pending locks are not marked as idle. + */ + + set_current_service(blr->fsp->conn, + SVAL(blr->req->inbuf,smb_flg), + false); + if(blocking_lock_record_process(blr)) { struct byte_range_lock *br_lck = brl_get_locks( talloc_tos(), blr->fsp); @@ -690,7 +697,6 @@ void process_blocking_lock_queue(void) DLIST_REMOVE(blocking_lock_queue, blr); TALLOC_FREE(blr); - recalc_timeout = True; continue; } @@ -729,13 +735,10 @@ void process_blocking_lock_queue(void) blocking_lock_reply_error(blr,NT_STATUS_FILE_LOCK_CONFLICT); DLIST_REMOVE(blocking_lock_queue, blr); TALLOC_FREE(blr); - recalc_timeout = True; } } - if (recalc_timeout) { - recalc_brl_timeout(); - } + recalc_brl_timeout(); } /**************************************************************************** |