lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50e45490-2d68-f882-97d8-a4548730caab@huaweicloud.com>
Date: Mon, 7 Apr 2025 09:21:24 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Zheng Qixing <zhengqixing@...weicloud.com>, song@...nel.org
Cc: linux-raid@...r.kernel.org, linux-kernel@...r.kernel.org,
 yi.zhang@...wei.com, yangerkun@...wei.com, zhengqixing@...wei.com,
 "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH V2] md/md-bitmap: fix stats collection for external
 bitmaps

在 2025/04/03 9:53, Zheng Qixing 写道:
> From: Zheng Qixing <zhengqixing@...wei.com>
> 
> 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@...wei.com>
> ---
>   drivers/md/md-bitmap.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
Applied to md-6.15
Thanks

> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 44ec9b17cfd3..37b08f26c62f 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -2357,9 +2357,8 @@ static int bitmap_get_stats(void *data, struct md_bitmap_stats *stats)
>   
>   	if (!bitmap)
>   		return -ENOENT;
> -	if (bitmap->mddev->bitmap_info.external)
> -		return -ENOENT;
> -	if (!bitmap->storage.sb_page) /* no superblock */
> +	if (!bitmap->mddev->bitmap_info.external &&
> +	    !bitmap->storage.sb_page)
>   		return -EINVAL;
>   	sb = kmap_local_page(bitmap->storage.sb_page);
>   	stats->sync_size = le64_to_cpu(sb->sync_size);
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ