Zero a finished fbio to decide rate with fellow_busy_io_get()

Have seen (fbo) != NULL in fellow_cache_async_write_complete():

 #14 0x00007f9aa30957e5 in fellow_cache_async_write_complete (fc=0x7f9aa2c41300, ptr=0x7f9a9ff4df58, result=4096)
    at fellow_cache.c:2791
 #15 0x00007f9aa3096403 in fellow_cache_seg_async_compl_cb (priv=0x7f9aa2c41300, status=0x7f9a999fa3e0, n=1)
    at fellow_cache.c:2951

(gdb) info local
fbio = 0x7f9a9ff4df58
fbo = 0x0
fcs = 0x0
fco = 0x7f9a9ff4f000
fcos_next = FCOS_INVAL
type = FBIO_SEG
io_outstanding = 2 '\002'
refcount = 0
__PRETTY_FUNCTION__ = "fellow_cache_async_write_complete"
lcb = {{magic = 2863944409, n_add = 0, l_rem = 2, n_rem = 0, fco = 0x7f9a9ff4f000, add = {vtqh_first = 0x0,
      vtqh_last = 0x7f9a999fa2b8}, fcs = 0x7f9a9ff4df5c}}
__func__ = "fellow_cache_async_write_complete"
_pterr281611 = <optimized out>
_pterr282913 = <optimized out>
_pterr289715 = <optimized out>
(gdb) p *fbio
$1 = {magic = 3019, retries = 0, type = FBIO_SEG, sync = FBIOS_ASYNC, fbo = 0x0, u = {fcs = 0x0, seglist = {fdsl = 0x0,
      reg = {off = 0, size = 0}}}}
parent c736f530
......@@ -2833,8 +2833,6 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
}
}
memset(fbio, 0, sizeof *fbio);
/* we keep the FCO writing until all else is written
* to avoid a race with evict, which removes the oc, which
* we need for writing the log
......@@ -2843,6 +2841,7 @@ fellow_cache_async_write_complete(struct fellow_cache *fc,
*
*/
AZ(pthread_mutex_lock(&fco->mtx));
memset(fbio, 0, sizeof *fbio);
AN(fbo->io_outstanding);
io_outstanding = --fbo->io_outstanding;
if (type == FBIO_SEG) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment