1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lv/vgchange: when refreshing whole vg skip snapshot

When refreshing all LVs in a VG, skip processing of thick snapshots,
since they will be refreshed through its origin LV.
Should reduce some unnecessary ioctl().
This commit is contained in:
Zdenek Kabelac 2023-01-31 22:48:43 +01:00
parent 0ec087e8b8
commit 94eda42e7a

View File

@ -883,7 +883,9 @@ int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg)
break; break;
} }
if (lv_is_visible(lvl->lv) && !lv_refresh(cmd, lvl->lv)) { if (lv_is_visible(lvl->lv) &&
!(lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv))) &&
!lv_refresh(cmd, lvl->lv)) {
r = 0; r = 0;
stack; stack;
} }
@ -3292,7 +3294,9 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
/* Skip availability change for non-virt snaps when processing all LVs */ /* Skip availability change for non-virt snaps when processing all LVs */
/* FIXME: pass process_all to process_single_lv() */ /* FIXME: pass process_all to process_single_lv() */
if (process_all && arg_is_set(cmd, activate_ARG) && if (process_all &&
(arg_is_set(cmd, activate_ARG) ||
arg_is_set(cmd, refresh_ARG)) &&
lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv))) lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv)))
continue; continue;