Fixed possible crash when draining writequeue

The write queue spinlock was released in dcb_write_tidy_up without first
acquiring it. This caused a crash when two threads try to interact with
the write queue at the same time.
This commit is contained in:
Markus Makela
2016-02-26 20:45:41 +02:00
parent b5b27740e3
commit f77afc6374

View File

@ -1474,8 +1474,6 @@ dcb_log_write_failure(DCB *dcb, GWBUF *queue, int eno)
static inline void
dcb_write_tidy_up(DCB *dcb, bool below_water)
{
spinlock_release(&dcb->writeqlock);
if (dcb->high_water && dcb->writeqlen > dcb->high_water && below_water)
{
atomic_add(&dcb->stats.n_high_water, 1);