projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b58b1b8
)
bcachefs: Fix bch2_journal_flush_device_pins()
author
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 18 Feb 2024 01:38:47 +0000
(20:38 -0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 25 Feb 2024 01:46:48 +0000
(20:46 -0500)
If a journal write errored, the list of devices it was written to could
be empty - we're not supposed to mark an empty replicas list.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_reclaim.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/journal_reclaim.c
b/fs/bcachefs/journal_reclaim.c
index 2cf626315652c0054df96ffce536ecc3d11f0969..c33dca641575dffc58b6db8354e71c879ed5cf26 100644
(file)
--- a/
fs/bcachefs/journal_reclaim.c
+++ b/
fs/bcachefs/journal_reclaim.c
@@
-892,9
+892,11
@@
int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
journal_seq_pin(j, seq)->devs);
seq++;
- spin_unlock(&j->lock);
- ret = bch2_mark_replicas(c, &replicas.e);
- spin_lock(&j->lock);
+ if (replicas.e.nr_devs) {
+ spin_unlock(&j->lock);
+ ret = bch2_mark_replicas(c, &replicas.e);
+ spin_lock(&j->lock);
+ }
}
spin_unlock(&j->lock);
err: