bcachefs: Shut down quicker

Internal writes (i.e. copygc/rebalance operations) shouldn't be blocking
on the allocator when we're going RO.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-03-18 11:46:46 -04:00 committed by Kent Overstreet
parent 97328a1a3c
commit 6d61724b2b

View file

@ -1070,6 +1070,12 @@ static void __bch2_write(struct closure *cl)
BKEY_EXTENT_U64s_MAX))
goto flush_io;
if ((op->flags & BCH_WRITE_FROM_INTERNAL) &&
percpu_ref_is_dying(&c->writes)) {
ret = -EROFS;
goto err;
}
wp = bch2_alloc_sectors_start(c,
op->target,
op->opts.erasure_code,