mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
thin: lock fs when converting to external origin
Ensure suspend is locking fs, when converting LV to external origin.
This commit is contained in:
parent
edc91caffb
commit
386f0bfb4f
@ -2193,15 +2193,22 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
|
|||||||
/* FIXME Consider aborting here */
|
/* FIXME Consider aborting here */
|
||||||
stack;
|
stack;
|
||||||
|
|
||||||
if (!laopts->origin_only &&
|
/* Require fs synchronization when taking a thin snapshot */
|
||||||
|
if (laopts->origin_only && lv_is_thin_volume(lv) && lv_is_thin_volume(lv_pre))
|
||||||
|
lockfs = 1;
|
||||||
|
/* Require fs synchronization when taking a thick snapshot */
|
||||||
|
else if (!laopts->origin_only &&
|
||||||
(lv_is_origin(lv_pre) || lv_is_cow(lv_pre)))
|
(lv_is_origin(lv_pre) || lv_is_cow(lv_pre)))
|
||||||
lockfs = 1;
|
lockfs = 1;
|
||||||
|
/* Require fs synchronization when converting a non-thin LV to a thin LV or
|
||||||
/* Converting non-thin LV to thin external origin ? */
|
* a non/thin LV with/out external origin to a thin LV with external origin LV. */
|
||||||
if (!lv_is_thin_volume(lv) && lv_is_thin_volume(lv_pre))
|
else if (!laopts->origin_only &&
|
||||||
lockfs = 1; /* Sync before conversion */
|
lv_is_thin_volume(lv_pre) && /* new LV is a Thin */
|
||||||
|
(!lv_is_thin_volume(lv) || /* and either the existing LV is NOT a Thin */
|
||||||
if (laopts->origin_only && lv_is_thin_volume(lv) && lv_is_thin_volume(lv_pre))
|
(first_seg(lv_pre)->external_lv && /* or the existing LV IS Thin and the new LV is Thin with the external origin */
|
||||||
|
(!first_seg(lv)->external_lv || /* and check if existing Thin is either without the external origin */
|
||||||
|
memcmp(&first_seg(lv_pre)->external_lv->lvid.id[1], /* or it uses a different external origin */
|
||||||
|
&first_seg(lv)->external_lv->lvid.id[1], ID_LEN) != 0))))
|
||||||
lockfs = 1;
|
lockfs = 1;
|
||||||
|
|
||||||
if (!lv_is_locked(lv) && lv_is_locked(lv_pre) &&
|
if (!lv_is_locked(lv) && lv_is_locked(lv_pre) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user