master - lv_rename: fix snapshot rename
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c61c5f360d00097fcb97ac9d9dec6687cd86e35f Commit: c61c5f360d00097fcb97ac9d9dec6687cd86e35f Parent: 17e8b6aa686958c49b9a4752ea235bbdc99a7643 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Sep 9 18:47:27 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Sep 10 21:57:38 2014 +0200
lv_rename: fix snapshot rename
Fix rename operation for snapshot (cow) LV.
Only the snapshot's origin has the lock and by mistake suspend and resume has been called for the snapshot LV.
This further made volumes unusable in cluster.
So instead of suspend and resuming list of LVs,
we need to just suspend and resume origin.
As the sequence write/suspend/commit/resume
is widely used in lvm2 code base - move it to
new lv_update_and_reload function.
--- WHATS_NEW | 2 + lib/metadata/lv_manip.c | 98 ++++++++++++++++++++++---------------- lib/metadata/metadata-exported.h | 4 ++ 3 files changed, 63 insertions(+), 41 deletions(-)
WHATS_NEW +2 -0
@@ -1,5 +1,7 @@ Version 2.02.112 - ===================================== + Introduce common code to modify metadate and reload updated LV. + Fix rename of active snapshot volume in cluster. Make sure shared libraries are built with RELRO option. Version 2.02.111 - 1st September 2014
lib/metadata/lv_manip.c +57 -41
124 lines not on this page · raw message
lib/metadata/metadata-exported.h +4 -0
@@ -700,6 +700,10 @@ int lv_rename(struct cmd_context *cmd, struct logical_volume *lv,int lv_rename_update (struct cmd_context *cmd,struct logical_volume *lv,const char *new_name,int update_mda); +/* Updates and reloads metadata for given lv */ +int lv_update_and_reload (struct logical_volume *lv); +int lv_update_and_reload_origin (struct logical_volume *lv); +uint64_t extents_from_size (struct cmd_context *cmd,uint64_t size,uint32_t extent_size);