Commit b66b2bc0 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Revert "Ensure journal doesn't get stuck in nochanges mode"

This patch was originally to work around the journal geting stuck in
nochanges mode - but that was just a hack, we needed to fix the actual
bug. It should be fixed now, so revert it.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent e201f70b
...@@ -431,7 +431,6 @@ static inline int bch2_journal_preres_get_fast(struct journal *j, ...@@ -431,7 +431,6 @@ static inline int bch2_journal_preres_get_fast(struct journal *j,
ret = 0; ret = 0;
if ((flags & JOURNAL_RES_GET_RESERVED) || if ((flags & JOURNAL_RES_GET_RESERVED) ||
test_bit(JOURNAL_NOCHANGES, &j->flags) ||
new.reserved + d < new.remaining) { new.reserved + d < new.remaining) {
new.reserved += d; new.reserved += d;
ret = 1; ret = 1;
......
...@@ -1616,7 +1616,7 @@ void bch2_journal_write(struct closure *cl) ...@@ -1616,7 +1616,7 @@ void bch2_journal_write(struct closure *cl)
w->devs_written = bch2_bkey_devs(bkey_i_to_s_c(&w->key)); w->devs_written = bch2_bkey_devs(bkey_i_to_s_c(&w->key));
if (test_bit(JOURNAL_NOCHANGES, &j->flags)) if (c->opts.nochanges)
goto no_io; goto no_io;
for_each_rw_member(ca, c, i) for_each_rw_member(ca, c, i)
......
...@@ -34,10 +34,8 @@ unsigned bch2_journal_dev_buckets_available(struct journal *j, ...@@ -34,10 +34,8 @@ unsigned bch2_journal_dev_buckets_available(struct journal *j,
struct journal_device *ja, struct journal_device *ja,
enum journal_space_from from) enum journal_space_from from)
{ {
unsigned available = !test_bit(JOURNAL_NOCHANGES, &j->flags) unsigned available = (journal_space_from(ja, from) -
? ((journal_space_from(ja, from) - ja->cur_idx - 1 + ja->nr) % ja->nr;
ja->cur_idx - 1 + ja->nr) % ja->nr)
: ja->nr;
/* /*
* Don't use the last bucket unless writing the new last_seq * Don't use the last bucket unless writing the new last_seq
......
...@@ -151,7 +151,6 @@ enum { ...@@ -151,7 +151,6 @@ enum {
JOURNAL_NEED_WRITE, JOURNAL_NEED_WRITE,
JOURNAL_MAY_GET_UNRESERVED, JOURNAL_MAY_GET_UNRESERVED,
JOURNAL_MAY_SKIP_FLUSH, JOURNAL_MAY_SKIP_FLUSH,
JOURNAL_NOCHANGES,
}; };
/* Embedded in struct bch_fs */ /* Embedded in struct bch_fs */
......
...@@ -835,9 +835,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) ...@@ -835,9 +835,6 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
if (ret) if (ret)
goto err; goto err;
if (c->opts.nochanges)
set_bit(JOURNAL_NOCHANGES, &c->journal.flags);
mi = bch2_sb_get_members(c->disk_sb.sb); mi = bch2_sb_get_members(c->disk_sb.sb);
for (i = 0; i < c->sb.nr_devices; i++) for (i = 0; i < c->sb.nr_devices; i++)
if (bch2_dev_exists(c->disk_sb.sb, mi, i) && if (bch2_dev_exists(c->disk_sb.sb, mi, i) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment