]> sourceware.org Git - lvm2.git/commitdiff
thin: fix low_water_mark threshold calc
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 11 Feb 2016 17:05:36 +0000 (18:05 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 11 Feb 2016 17:30:24 +0000 (18:30 +0100)
Reporter noticed lvm2 incorrectly translated
lvm2 threshold value to  water mark in commit:
99237f0908d87592815f4bdf3c239e8a108e835c

Fix it by properly translating size to number of
blocks in thin-pool and then calc for free blocks
matching configured lvm2 threshold value.

Reported-by: Ming-Hung Tsai <mingnus@gmail.com>
WHATS_NEW
lib/thin/thin.c

index 6ae8126e3fc4f3a9aa43fd89a25fc3d73b87e054..002217d484d4f8f20c87e42ac6a87c256bf1a615 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.142 - 
 ====================================
+  Fix thinp watermark calc for data LV for faster dmeventd responce (2.02.133).
   Use use_blkid_wiping=0 if not defined in lvm.conf and support not compiled in.
   Do not check for suspended devices if scanning for lvmetad update.
   Fix part. table filter with external_device_info_source="udev" and blkid<2.20.
index 9fbad32dc3190d4e50699df4ea43dd6948fdea2b..c9ee9f5301f684c5b01daa6912263e1983c608da 100644 (file)
@@ -295,9 +295,10 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
        if (threshold < 50)
                threshold = 50;
        if (threshold < 100)
-               low_water_mark = (len * threshold + 99) / 100;
+               /* Translate to number of free pool blocks to trigger watermark */
+               low_water_mark = len / seg->chunk_size * (100 - threshold) / 100;
        else
-               low_water_mark = len;
+               low_water_mark = 0;
 
        if (!dm_tree_node_add_thin_pool_target(node, len,
                                               seg->transaction_id,
This page took 0.05106 seconds and 5 git commands to generate.