Skip to content

Commit 396294d

Browse files
adam900710kdave
authored andcommitted
btrfs: subpage: fix the bitmap dump of the locked flags
We're dumping the locked bitmap into the @checked_bitmap variable, printing incorrect values during debug. Thankfully even during my development I haven't hit a case where I need to dump the locked bitmap. But for the sake of consistency, fix it by dupping the locked bitmap into @locked_bitmap variable for output. Fixes: 75258f2 ("btrfs: subpage: dump extra subpage bitmaps for debug") Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c2b47df commit 396294d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/btrfs/subpage.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ void __cold btrfs_subpage_dump_bitmap(const struct btrfs_fs_info *fs_info,
716716
unsigned long writeback_bitmap;
717717
unsigned long ordered_bitmap;
718718
unsigned long checked_bitmap;
719+
unsigned long locked_bitmap;
719720
unsigned long flags;
720721

721722
ASSERT(folio_test_private(folio) && folio_get_private(folio));
@@ -728,15 +729,16 @@ void __cold btrfs_subpage_dump_bitmap(const struct btrfs_fs_info *fs_info,
728729
GET_SUBPAGE_BITMAP(subpage, fs_info, writeback, &writeback_bitmap);
729730
GET_SUBPAGE_BITMAP(subpage, fs_info, ordered, &ordered_bitmap);
730731
GET_SUBPAGE_BITMAP(subpage, fs_info, checked, &checked_bitmap);
731-
GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &checked_bitmap);
732+
GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &locked_bitmap);
732733
spin_unlock_irqrestore(&subpage->lock, flags);
733734

734735
dump_page(folio_page(folio, 0), "btrfs subpage dump");
735736
btrfs_warn(fs_info,
736-
"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
737+
"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl locked=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
737738
start, len, folio_pos(folio),
738739
sectors_per_page, &uptodate_bitmap,
739740
sectors_per_page, &dirty_bitmap,
741+
sectors_per_page, &locked_bitmap,
740742
sectors_per_page, &writeback_bitmap,
741743
sectors_per_page, &ordered_bitmap,
742744
sectors_per_page, &checked_bitmap);

0 commit comments

Comments
 (0)