diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-12 16:56:11 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-06-12 19:14:27 -0400 |
commit | fee7bfda25d14f678eab996afe12b4f162980a35 (patch) | |
tree | a150b020f7f7ea53a39f749dfcb6d3c2d58cbf0f | |
parent | a5ae460b0b11ab1ffbc5d08235c125b60d183574 (diff) |
fixup! bcachefs: Hacky io-in-flight throttling
-rw-r--r-- | fs/bcachefs/io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 6287b04931ba..c309080c9de0 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -500,7 +500,8 @@ static void bch2_write_done(struct closure *cl) bch2_time_stats_update(&c->times[BCH_TIME_data_write], op->start_time); - up(&c->io_in_flight); + if (!(op->flags & BCH_WRITE_FROM_INTERNAL)) + up(&c->io_in_flight); if (op->end_io) { EBUG_ON(cl->parent); @@ -1260,7 +1261,11 @@ void bch2_write(struct closure *cl) goto err; } - down(&c->io_in_flight); + /* + * Can't ratelimit copygc - we'd deadlock: + */ + if (!(op->flags & BCH_WRITE_FROM_INTERNAL)) + down(&c->io_in_flight); bch2_increment_clock(c, bio_sectors(bio), WRITE); |