Zach Brown e7b5cd4c66 scoutfs: limit get_block bh use
We were seeing __block_write_begin spin when staging writes were called
after a read of an offline region saw an error.  It turns out that
the way __block_write_begin iterates through buffer heads on a page will
livelock if b_size is 0.

Our get_block was clearing b_blocknr and b_size before doing anything.
It'd set them when it allocated blocks or found existing mapped
blocks.  But it'd leave them 0 on an error and trigger this hang.

So we'll back off and only do the same things to the result bh that
ext2/3 do, presumably that's what's actually supported.  We only set
mapped, set or clear new, and set b_size to less than the input b_size.

While we're at it we remove a totally bogus extent flag check that's
done before seeing if the next extent we found even intersects with the
logical block that we're searching for.  The extra test is performed
again correctly inside the check for the extents overlapping.  It is an
artifact from the days when the "extents" were a single block and didn't
need to check for overlaps.

Signed-off-by: Zach Brown <zab@versity.com>
2017-09-07 13:49:37 -07:00
2017-09-07 13:49:37 -07:00
Description
No description provided
8 MiB
Languages
C 87%
Shell 9.3%
Roff 2.5%
TeX 0.8%
Makefile 0.4%