nfs-utils: calculate stripe device size during process phase
Subsystems (2)
PATCH 1/1 nfs-utils: calculate stripe device size during process phase
If a device has stripe device components, the total size will be wrong. Calculate the stripe device size earlier, during the process phase, so that later devices will have the correct size.
Signed-off-by Jim Rees <[email protected]>
--- utils/blkmapd/device-process.c | 3 ++- utils/blkmapd/dm-device.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
utils/blkmapd/device-process.c +2 -1
@@ -318,7 +318,8 @@ decode_blk_volume(uint32_t **pp, uint32_t *end, struct bl_volume *vols, int voln } }/* Truncate size to a stripe unit boundary */ - vol->bv_size = vol->bv_vols[0 ]->bv_size & ~(chunksize -1 ); + vol->bv_size = vol->bv_vols[0 ]->bv_size * vol->bv_vol_n; + vol->bv_size &= ~(chunksize -1 );break ;case BLOCK_VOLUME_CONCAT :BLK_READBUF (p, end,4 );
utils/blkmapd/dm-device.c +1 -1
@@ -418,7 +418,7 @@ uint64_t dm_device_create(struct bl_volume *vols, int num_vols) stripe_size = stripe_unit * node->bv_vol_n; nstripes = node->bv_size * node->bv_vol_n / stripe_size;/* Make sure total size is a multiple of stripe size */ - size = node->bv_size * node->bv_vol_n; + size = node->bv_size;if (size % stripe_size !=0 ) {/* XXX Should this be an error? */ BL_LOG_WARNING(
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Merged. Thanks!
Benny
Quoted 37 lines · Jim Rees
If a device has stripe device components, the total size will be wrong. Calculate the stripe device size earlier, during the process phase, so that later devices will have the correct size.
Signed-off-by Jim Rees <[email protected]>--- utils/blkmapd/device-process.c | 3 ++- utils/blkmapd/dm-device.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)utils/blkmapd/device-process.c +2
-1@@ -318,7 +318,8 @@ decode_blk_volume(uint32_t **pp, uint32_t *end, struct bl_volume *vols, int voln } }/* Truncate size to a stripe unit boundary */ - vol->bv_size = vol->bv_vols[0 ]->bv_size & ~(chunksize -1 ); + vol->bv_size = vol->bv_vols[0 ]->bv_size * vol->bv_vol_n; + vol->bv_size &= ~(chunksize -1 );break ;case BLOCK_VOLUME_CONCAT :BLK_READBUF (p, end,4 );utils/blkmapd/dm-device.c +1
-1@@ -418,7 +418,7 @@ uint64_t dm_device_create(struct bl_volume *vols, int num_vols) stripe_size = stripe_unit * node->bv_vol_n; nstripes = node->bv_size * node->bv_vol_n / stripe_size;/* Make sure total size is a multiple of stripe size */ - size = node->bv_size * node->bv_vol_n; + size = node->bv_size;if (size % stripe_size !=0 ) {/* XXX Should this be an error? */ BL_LOG_WARNING(