1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-02 04:22:02 +03:00

backup: automatically store data on vg_unlock

Previously there have been necessary explicit call of backup (often
either forgotten or over-used). With this patch the necessity to
store backup is remember at vg_commit and once the VG is unlocked,
the committed metadata are automatically store in backup file.

This may possibly alter some printed messages from command when the
backup is now taken later.
This commit is contained in:
Zdenek Kabelac
2021-06-08 19:39:15 +02:00
parent ba3707d953
commit bb45e33518
19 changed files with 18 additions and 86 deletions

View File

@ -56,8 +56,11 @@ int lock_vol(struct cmd_context *cmd, const char *vol, uint32_t flags, const str
#define unlock_vg(cmd, vg, vol) \
do { \
if (is_real_vg(vol) && !sync_local_dev_names(cmd)) \
stack; \
if (is_real_vg(vol)) { \
if (!sync_local_dev_names(cmd)) \
stack; \
vg_backup_if_needed(vg); \
} \
if (!lock_vol(cmd, vol, LCK_VG_UNLOCK, NULL)) \
stack; \
} while (0)