bcachefs: Check for folios that don't have bch_folio attached
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 27 Mar 2023 20:55:27 +0000 (16:55 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:59 +0000 (17:09 -0400)
commit34fdcf0632a5e549c5bfed1847a6d6995606ec17
tree619ac66b860e353731dd1a7e9a29d7ada054858e
parent9567413c82d9dbad24ff6edd0dd160da8b6d9d8f
bcachefs: Check for folios that don't have bch_folio attached

With large folios, it's now incidentally possible to end up with a
clean, uptodate folio in the page cache that doesn't have a bch_folio
attached, if a folio has to be split.

This patch fixes __bch2_truncate_folio() to check for this; other code
paths appear to handle it.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io.c