From: Kent Overstreet Date: Mon, 27 Mar 2023 19:16:24 +0000 (-0400) Subject: bcachefs: Add a bch_page_state assert X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c437e1537916e3c0fcc04387888e402a5940e49c;p=linux.git bcachefs: Add a bch_page_state assert Seeing an odd bug with page/folio state not being properly initialized, this is to help track it down. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index d98b654c92b12..e25dbbf46107e 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -2682,6 +2682,8 @@ static int __bch2_truncate_page(struct bch_inode_info *inode, goto unlock; } + BUG_ON(!s->uptodate); + if (index != start >> PAGE_SHIFT) start_offset = 0; if (index != end >> PAGE_SHIFT)