From: Kent Overstreet Date: Fri, 8 Mar 2019 00:45:57 +0000 (-0500) Subject: bcachefs: assertion to catch outstanding bug X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=812af308de34f5bc3fc0d30a00f826ad159a724f;p=linux.git bcachefs: assertion to catch outstanding bug Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/super-io.c b/fs/bcachefs/super-io.c index 66e174d93a9c2..c89fe5d630e46 100644 --- a/fs/bcachefs/super-io.c +++ b/fs/bcachefs/super-io.c @@ -1027,7 +1027,10 @@ void bch2_fs_mark_clean(struct bch_fs *c, bool clean) sb_clean->flags = 0; sb_clean->read_clock = cpu_to_le16(c->bucket_clock[READ].hand); sb_clean->write_clock = cpu_to_le16(c->bucket_clock[WRITE].hand); - sb_clean->journal_seq = journal_cur_seq(&c->journal) - 1; + sb_clean->journal_seq = cpu_to_le64(journal_cur_seq(&c->journal) - 1); + + /* Trying to catch outstanding bug: */ + BUG_ON(le64_to_cpu(sb_clean->journal_seq) > S64_MAX); entry = sb_clean->start; entry = bch2_journal_super_entries_add_common(c, entry, 0);