Skip to content

Commit 422662b

Browse files
adam900710kdave
authored andcommitted
btrfs: output more info when btrfs_subpage_assert() failed
The function btrfs_subpage_assert() is a very commonly utilized assert to make sure the range passed in is correct inside the folio. And when some code is not properly subpage/large folio compatible btrfs_subpage_assert() will be the first to be triggered. E.g. when I incorrectly enabled large folios for data reloc inodes, it immediately triggered btrfs_subpage_assert(). In that case, outputting all the involved members will be very helpful, this includes: - start - len - folio position inside the mapping - folio size Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 1ce433a commit 422662b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/btrfs/subpage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ static void btrfs_subpage_assert(const struct btrfs_fs_info *fs_info,
186186
* unmapped page like dummy extent buffer pages.
187187
*/
188188
if (folio->mapping)
189-
ASSERT(folio_pos(folio) <= start &&
190-
start + len <= folio_end(folio));
189+
ASSERT(folio_pos(folio) <= start && start + len <= folio_end(folio),
190+
"start=%llu len=%u folio_pos=%llu folio_size=%zu",
191+
start, len, folio_pos(folio), folio_size(folio));
191192
}
192193

193194
#define subpage_calc_start_bit(fs_info, folio, name, start, len) \

0 commit comments

Comments
 (0)