drbdmeta: also show negotiated size in sectors
PATCH 1/1 drbdmeta: also show negotiated size in sectors
Currently drbdmeta shows the last agreed size in "nice" units, e.g. 100GB. But this is imprecise, as the shifting of cfg->md.la_sect loses the low-order bits.
This small patch adds a new line to the output of drbdmeta that shows the exact negotiated size in sectors (for both new and initialized devices), such that the output of drbdmeta can be parsed.
---
This is against drbd 8.3 but should apply (and I would be grateful if this is applied) to 8.0 too.
thanks,
iustin
user/drbdmeta.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
user/drbdmeta.c +2 -0
@@ -1481,6 +1481,8 @@ int meta_show_gi(struct format *cfg, char **argv __attribute((unused)), int argc }else {printf ("zero size device -- never seen peer yet?\n" ); } +printf ("last agreed size in sectors: %zd\n" , + cfg->md.la_sect);return cfg->ops->close (cfg); }
Signature · 1 line
1.6.3.3
Lars Ellenberg
maintainerQuoted 10 lines · Iustin Pop
Currently drbdmeta shows the last agreed size in "nice" units, e.g. 100GB. But this is imprecise, as the shifting of
cfg->md.la_sectloses the low-order bits.This small patch adds a new line to the output of drbdmeta that shows the exact negotiated size in sectors (for both new and initialized devices), such that the output of drbdmeta can be parsed.
---
This is against drbd 8.3 but should apply (and I would be grateful if this is applied) to 8.0 too.
May I ask what the use case is?
Signature · 5 lines
: Lars Ellenberg : LINBIT | Your Way to High Availability : DRBD/HA support and consulting http://www.linbit.com DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.