summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/journal_reclaim.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-09 04:21:45 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:10:06 +0200
commit9a644843c4701f86594fe0386f00af6b847f747d (patch)
tree73761c444c1d06af4fab4c3cc981e23d7365d245 /fs/bcachefs/journal_reclaim.c
parentbcachefs: version_upgrade is now an enum (diff)
downloadlinux-9a644843c4701f86594fe0386f00af6b847f747d.tar.xz
linux-9a644843c4701f86594fe0386f00af6b847f747d.zip
bcachefs: Fix error path in bch2_journal_flush_device_pins()
We need to always call bch2_replicas_gc_end() after we've called bch2_replicas_gc_start(), else we leave state around that needs to be cleaned up. Partial fix for: https://github.com/koverstreet/bcachefs/issues/560 Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.c')
-rw-r--r--fs/bcachefs/journal_reclaim.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c
index 72486f1f8a8e..8de83e103751 100644
--- a/fs/bcachefs/journal_reclaim.c
+++ b/fs/bcachefs/journal_reclaim.c
@@ -845,10 +845,8 @@ int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
* expects to find devices marked for journal data on unclean mount.
*/
ret = bch2_journal_meta(&c->journal);
- if (ret) {
- mutex_unlock(&c->replicas_gc_lock);
- return ret;
- }
+ if (ret)
+ goto err;
seq = 0;
spin_lock(&j->lock);
@@ -867,7 +865,7 @@ int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
spin_lock(&j->lock);
}
spin_unlock(&j->lock);
-
+err:
ret = bch2_replicas_gc_end(c, ret);
mutex_unlock(&c->replicas_gc_lock);