On Mon, Jul 08, 2019 at 09:19:19AM -0700, Darrick J. Wong wrote: > The submit_bio_wait blows away our old assignment of bio1->bi_end_io == > bio_chain_endio and replaces it with submit_bio_wait_endio. So > xfs_rw_bdev waits /only/ for bio1 to finish and exits without waiting > for bio0, and if you're lucky bio0 completes soon enough that the caller > doesn't notice. AFAICT, I think bio0 just leaks. > > So I think the solution is that we have to call submit_bio_wait on that > very first bio (bio0) since the bios created in the inner loop will be > chained to it... ? Thoughts/flames/"go finish your morning coffee"? I'm going to finish my morning coffee first given that I'm on pacific time at the moment, but the analysis sounds relatively sane.