Re: [PATCH v3 09/16] bcache: handle c->uuids properly for bucket size > 8MB

Hannes Reinecke
2020-07-15T15:37:38Z

On 7/15/20 4:30 PM, colyli@suse.de wrote:
> From: Coly Li <colyli@suse.de>
>
> Bcache allocates a whole bucket to store c->uuids on cache device, and
> allocates continuous pages to store it in-memory. When the bucket size
> exceeds maximum allocable continuous pages, bch_cache_set_alloc() will
> fail and cache device registration will fail.
>
> This patch allocates c->uuids by alloc_meta_bucket_pages(), and uses
> ilog2(meta_bucket_pages(c)) to indicate order of c->uuids pages when
> free it. When writing c->uuids to cache device, its size is decided
> by meta_bucket_pages(c) * PAGE_SECTORS. Now c->uuids is properly handled
> for bucket size > 8MB.
>
> Signed-off-by: Coly Li <colyli@suse.de>
> ---
> drivers/md/bcache/super.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer