[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/6] block/parallels: BDRVParallelsState: add cluster_size
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2 3/6] block/parallels: BDRVParallelsState: add cluster_size field |
Date: |
Thu, 4 Mar 2021 15:24:50 +0100 |
Am 24.02.2021 um 11:47 hat Vladimir Sementsov-Ogievskiy geschrieben:
> We are going to use it in more places, calculating
> "s->tracks << BDRV_SECTOR_BITS" doesn't look good.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> @@ -771,6 +770,7 @@ static int parallels_open(BlockDriverState *bs, QDict
> *options, int flags,
> ret = -EFBIG;
> goto fail;
> }
> + s->cluster_size = s->tracks << BDRV_SECTOR_BITS;
>
> s->bat_size = le32_to_cpu(ph.bat_entries);
> if (s->bat_size > INT_MAX / sizeof(uint32_t)) {
Checking the context, I saw this a few lines above:
if (s->tracks > INT32_MAX/513) {
Is the 513 intentional?
Kevin
- Re: [PATCH v2 3/6] block/parallels: BDRVParallelsState: add cluster_size field,
Kevin Wolf <=