]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: subpage: fix the bitmap dump of the locked flags
authorQu Wenruo <wqu@suse.com>
Thu, 12 Dec 2024 06:14:00 +0000 (16:44 +1030)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 14:53:47 +0000 (15:53 +0100)
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: 75258f20fb70 ("btrfs: subpage: dump extra subpage bitmaps for debug")
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/subpage.c

index 8c68059ac1b0c12b058ecc4d451d44fc740d456f..03d7bfc042e2ae73ecc317d5d9b3523062267e9b 100644 (file)
@@ -716,6 +716,7 @@ void __cold btrfs_subpage_dump_bitmap(const struct btrfs_fs_info *fs_info,
        unsigned long writeback_bitmap;
        unsigned long ordered_bitmap;
        unsigned long checked_bitmap;
+       unsigned long locked_bitmap;
        unsigned long flags;
 
        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,
        GET_SUBPAGE_BITMAP(subpage, fs_info, writeback, &writeback_bitmap);
        GET_SUBPAGE_BITMAP(subpage, fs_info, ordered, &ordered_bitmap);
        GET_SUBPAGE_BITMAP(subpage, fs_info, checked, &checked_bitmap);
-       GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &checked_bitmap);
+       GET_SUBPAGE_BITMAP(subpage, fs_info, locked, &locked_bitmap);
        spin_unlock_irqrestore(&subpage->lock, flags);
 
        dump_page(folio_page(folio, 0), "btrfs subpage dump");
        btrfs_warn(fs_info,
-"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
+"start=%llu len=%u page=%llu, bitmaps uptodate=%*pbl dirty=%*pbl locked=%*pbl writeback=%*pbl ordered=%*pbl checked=%*pbl",
                    start, len, folio_pos(folio),
                    sectors_per_page, &uptodate_bitmap,
                    sectors_per_page, &dirty_bitmap,
+                   sectors_per_page, &locked_bitmap,
                    sectors_per_page, &writeback_bitmap,
                    sectors_per_page, &ordered_bitmap,
                    sectors_per_page, &checked_bitmap);