1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
corubba 4f4554164b lvmlockd: Fix sanlock lvmlock lv size calculation
The number of extents for the sanlock lvmlock lv is calculated using
integer division, which rounds towards zero. With a physical extent size
of 129M, instead of the requested 256M the lv is only 129M (1 extent).
With any physical extent size greater than 256M the lv creation fails
because the number of extents is zero.

This is fixed by replacing the integer division with a division macro
that rounds up and thus guarantees that the size of the lv will always
be equal or greater than the requested size. Using the examples above, a
pes of 129M will result in a 258M lv (2 extents), pes of 300M in a 300M
lv (1 extent).

The re-calculation of the lv size in bytes and megabytes is only so the
debug output shows the correct values. The size in mb there is still
not byte-perfect-accurate, but good enough for a human-readable estimate;
and the exact size in bytes and extents is right next to it.

Signed-off-by: corubba <corubba@gmx.de>
2022-10-12 09:19:01 -05:00
..
activate lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00
cache covscan: free wwid strings in lvmcache 2022-09-21 12:15:13 -05:00
cache_segtype gcc: remove invalid attribute 2021-09-13 12:34:41 +02:00
commands make: move cmds.h 2022-09-27 09:06:06 -05:00
config device id: add new types using values from vpd_pg83 2022-10-10 11:47:29 -05:00
datastruct cleanup: eliminate unused assign 2021-03-11 00:18:01 +01:00
device lvmdevices: use deviceidtype option strictly 2022-10-10 11:47:29 -05:00
display gcc-fanalyzer: helping understand answer is not null 2021-09-21 21:03:47 +02:00
error device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
filters filters: remove unused internal filter 2022-04-06 12:51:34 -05:00
format_text _vg_read_raw_area: fix segfault caused by using null pointer 2022-08-15 09:39:02 -05:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity cleanup: no backtraces needed after log_error 2021-03-10 01:11:52 +01:00
label cov: remove unused headers 2022-07-11 01:18:24 +02:00
locking lvmlockd: Fix sanlock lvmlock lv size calculation 2022-10-12 09:19:01 -05:00
log shell: add pre-cmd log report object type and enable lastlog for it 2022-08-22 14:06:34 +02:00
lvmpolld device usage based on devices file 2021-02-23 16:43:32 -06:00
metadata toollib: do not process just created historical LV 2022-10-12 15:14:59 +02:00
mirror lv_info: missing check for info.exists 2021-03-14 16:34:38 +01:00
misc utils: define macro for ffs 2021-09-27 18:56:14 +02:00
mm mm: use mallinfo2 when available 2022-08-30 13:56:16 +02:00
notify build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
properties build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
raid cleanup: reduce code dupliction 2021-03-19 23:21:18 +01:00
report report: fix lv_active column type from STR to BIN 2022-09-06 15:49:27 +02:00
snapshot typo: fixes 2021-02-08 23:53:41 +01:00
striped device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
thin thin: rename internal function 2022-08-30 13:54:19 +02:00
unknown device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
uuid asan: fix some reports from libasan 2022-02-07 20:02:11 +01:00
vdo vdo: support v4 kernel target line 2022-07-11 01:18:24 +02:00
writecache typo: fixes 2021-02-08 23:53:41 +01:00
zero device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
Makefile.in lvresize: add new options and defaults for fs handling 2022-09-13 15:15:05 -05:00