master - wiping: wipe DM_snapshot_cow signature without prompt in newly created LVs
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ed166a3b1d3290ad887d8f83c24a8d8877713d3c Commit: ed166a3b1d3290ad887d8f83c24a8d8877713d3c Parent: 56358160948554e1eb8dc7c5a86dbad4216376fd Author: Peter Rajnoha <[email protected]> AuthorDate: Mon Feb 10 13:28:13 2014 +0100 Committer: Peter Rajnoha <[email protected]> CommitterDate: Mon Feb 10 13:28:13 2014 +0100
wiping: wipe DM_snapshot_cow signature without prompt in newly created LVs
The libblkid can detect DM_snapshot_cow signature and when creating new LVs with blkid wiping used (allocation/use_blkid_wiping=1 lvm.conf setting and --wipe y used at the same time - which it is by default).
Do not issue any prompts about this signature when new LV is created and just wipe it right away without asking questions. Still keep the log in verbose mode though.
--- WHATS_NEW | 1 + lib/device/dev-type.c | 47 ++++++++++++++++++++++++++++++++--------------- lib/device/dev-type.h | 6 +++++- lib/metadata/lv_manip.c | 4 +++- lib/metadata/metadata.c | 4 +++- 5 files changed, 44 insertions(+), 18 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.106 - ==================================== + Wipe DM_snapshot_cow signature without prompt in new LVs with blkid wiping. Avoid exposing temporary devices when initializing raid metadata volumes. Add internal tags command to display any tags defined on the host. Prohibit use of external origin with size incompatible with thin pool.
lib/device/dev-type.c +32 -15
100 lines not on this page · raw message
lib/device/dev-type.h +5 -1
@@ -60,8 +60,12 @@ int dev_is_swap(struct device *dev, uint64_t *signature);int dev_is_luks (struct device *dev,uint64_t *signature);/* Signature wiping. */ +#define TYPE_LVM1_MEMBER 0x001 +#define TYPE_LVM2_MEMBER 0x002 +#define TYPE_DM_SNAPSHOT_COW 0x004int wipe_known_signatures (struct cmd_context *cmd,struct device *dev,const char *name, -int exclude_lvm_member,int yes,force_t force); +uint32_t types_to_exclude,uint32_t types_no_prompt, +int yes,force_t force);/* Type-specific device properties */ unsigned long dev_md_stripe_width (struct dev_types *dt,struct device *dev);
lib/metadata/lv_manip.c +3 -1
@@ -5538,7 +5538,9 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)if (wp.do_wipe_signatures) {log_verbose ("Wiping known signatures on logical volume \"%s/%s\"" , lv->vg->name, lv->name); -if (!wipe_known_signatures (lv->vg->cmd, dev, name,0 , wp.yes, wp.force)) +if (!wipe_known_signatures (lv->vg->cmd, dev, name,0 , +TYPE_DM_SNAPSHOT_COW , + wp.yes, wp.force)) stack; }
lib/metadata/metadata.c +3 -1
@@ -1372,7 +1372,9 @@ static int pvcreate_check(struct cmd_context *cmd, const char *name, goto bad; } -if (!wipe_known_signatures (cmd, dev, name,1 , pp->yes, pp->force)) { +if (!wipe_known_signatures (cmd, dev, name, +TYPE_LVM1_MEMBER |TYPE_LVM2_MEMBER , +0 , pp->yes, pp->force)) {log_error ("Aborting pvcreate on %s." , name); goto bad; }