From: Kent Overstreet Date: Wed, 18 Mar 2020 15:46:46 +0000 (-0400) Subject: bcachefs: Shut down quicker X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6d61724b2ba1836e4e1f5f8755cb2278d4eae1a0;p=linux.git 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 Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 2ec7203e58248..3dcb166afa231 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -1070,6 +1070,12 @@ again: 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,