1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

thin: check for overflown pool earlier

Check for pool early before we actually start to modify metadata.
This requires locally active thin-pool.
This commit is contained in:
Zdenek Kabelac 2015-10-07 15:10:03 +02:00
parent 5695c6aca6
commit c7b4359ff4
2 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.133 - Version 2.02.133 -
====================================== ======================================
Check for enough space in thin-pool in command before creating new thin.
Make libblkid detect all copies of the same signature if use_blkid_wiping=1. Make libblkid detect all copies of the same signature if use_blkid_wiping=1.
Fix vgimportclone with -n to not add number unnecessarily to base VG name. Fix vgimportclone with -n to not add number unnecessarily to base VG name.
Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr. Cleanup vgimportclone script and remove dependency on awk, grep, cut and tr.

View File

@ -7087,12 +7087,18 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
} }
} }
if (seg_is_thin_volume(lp) && if (seg_is_thin_volume(lp)) {
lv_is_new_thin_pool(pool_lv)) { if (lv_is_new_thin_pool(pool_lv)) {
thin_pool_was_active = lv_is_active(pool_lv); thin_pool_was_active = lv_is_active(pool_lv);
if (!check_new_thin_pool(pool_lv)) if (!check_new_thin_pool(pool_lv))
return_NULL; return_NULL;
/* New pool is now inactive */ /* New pool is now inactive */
} else if (!pool_below_threshold(first_seg(pool_lv))) {
log_error("Cannot create new thin volume, free space in "
"thin pool %s reached threshold.",
display_lvname(pool_lv));
return NULL;
}
} }
if (seg_is_cache(lp) && if (seg_is_cache(lp) &&