diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-02-26 17:35:47 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-02-26 19:12:07 -0500 |
commit | dbb99e492daa3ffe623685f3871dfcb97c01cd4f (patch) | |
tree | dde888ef9b2163678336f7803be970ba6a3ce8df /libbcachefs/journal_io.c | |
parent | ac0d08877aa87a9cdf493bc6f336c391fb4e04a0 (diff) |
Update bcachefs sources to 1210f6c925 bcachefs: BCH_SB_FEATURES_ALL
Diffstat (limited to 'libbcachefs/journal_io.c')
-rw-r--r-- | libbcachefs/journal_io.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbcachefs/journal_io.c b/libbcachefs/journal_io.c index db722a8a..0974805c 100644 --- a/libbcachefs/journal_io.c +++ b/libbcachefs/journal_io.c @@ -1043,9 +1043,16 @@ void bch2_journal_write(struct closure *cl) bytes = vstruct_bytes(jset); memset((void *) jset + bytes, 0, (sectors << 9) - bytes); +retry_alloc: spin_lock(&j->lock); ret = journal_write_alloc(j, w, sectors); + if (ret && j->can_discard) { + spin_unlock(&j->lock); + bch2_journal_do_discards(j); + goto retry_alloc; + } + /* * write is allocated, no longer need to account for it in * bch2_journal_space_available(): |