]> www.infradead.org Git - nvme.git/commit
md/md-bitmap: fix stats collection for external bitmaps
authorZheng Qixing <zhengqixing@huawei.com>
Thu, 3 Apr 2025 01:53:22 +0000 (09:53 +0800)
committerYu Kuai <yukuai3@huawei.com>
Sun, 6 Apr 2025 04:55:13 +0000 (12:55 +0800)
commit6ec1f0239485028445d213d91cfee5242f3211ba
tree10648b684c296ab3e12aacbc72db577508c7f8e0
parentd05af90d6218e9c8f1c2026990c3f53c1b41bfb0
md/md-bitmap: fix stats collection for external bitmaps

The bitmap_get_stats() function incorrectly returns -ENOENT for external
bitmaps.

Remove the external bitmap check as the statistics should be available
regardless of bitmap storage location.

Return -EINVAL only for invalid bitmap with no storage (neither in
superblock nor in external file).

Note: "bitmap_info.external" here refers to a bitmap stored in a separate
file (bitmap_file), not to external metadata.

Fixes: 8d28d0ddb986 ("md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime")
Signed-off-by: Zheng Qixing <zhengqixing@huawei.com>
Link: https://lore.kernel.org/linux-raid/20250403015322.2873369-1-zhengqixing@huaweicloud.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
drivers/md/md-bitmap.c