Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150473 Details for
Bug 202885
vgsplit needs to check if all pvs being split out have metadata space
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
lvm2-vgsplit-mdas.patch (text/plain), 2.95 KB, created by
Milan Broz
on 2007-03-20 10:56:18 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Milan Broz
Created:
2007-03-20 10:56:18 UTC
Size:
2.95 KB
patch
obsolete
>Index: lib/format_text/format-text.h >=================================================================== >RCS file: /cvs/lvm2/LVM2/lib/format_text/format-text.h,v >retrieving revision 1.20 >diff -u -r1.20 format-text.h >--- lib/format_text/format-text.h 11 May 2006 17:58:58 -0000 1.20 >+++ lib/format_text/format-text.h 20 Mar 2007 10:43:01 -0000 >@@ -58,4 +58,7 @@ > struct device_area *dev_area, struct id *vgid, > uint32_t *vgstatus, char **creation_host); > >+/* Move all mdas from mdas_in which are not in vg to mdas_out */ >+void vg_split_mdas(struct volume_group *vg, struct list *mdas_in, struct list *mdas_out); >+ > #endif >Index: lib/format_text/text_label.c >=================================================================== >RCS file: /cvs/lvm2/LVM2/lib/format_text/text_label.c,v >retrieving revision 1.17 >diff -u -r1.17 text_label.c >--- lib/format_text/text_label.c 30 Nov 2006 23:11:41 -0000 1.17 >+++ lib/format_text/text_label.c 20 Mar 2007 10:43:01 -0000 >@@ -291,3 +291,30 @@ > > return l; > } >+ >+/* Move all mdas from mdas_in which are not in vg to mdas_out */ >+void vg_split_mdas(struct volume_group *vg, struct list *mdas_in, struct list *mdas_out) >+{ >+ struct metadata_area *mda, *mda2; >+ struct mda_context *mdac; >+ struct pv_list *pvl; >+ int need_move; >+ >+ list_iterate_items_safe(mda, mda2, mdas_in) { >+ mdac = (struct mda_context *) mda->metadata_locn; >+ need_move = 1; >+ >+ list_iterate_items(pvl, &vg->pvs) { >+ if (pvl->pv->dev == mdac->area.dev) { >+ need_move = 0; >+ break; >+ } >+ } >+ >+ if (need_move) { >+ list_del(&mda->list); >+ list_add(mdas_out, &mda->list); >+ } >+ } >+} >+ >Index: tools/vgsplit.c >=================================================================== >RCS file: /cvs/lvm2/LVM2/tools/vgsplit.c,v >retrieving revision 1.23 >diff -u -r1.23 vgsplit.c >--- tools/vgsplit.c 9 Mar 2007 21:25:33 -0000 1.23 >+++ tools/vgsplit.c 20 Mar 2007 10:43:01 -0000 >@@ -206,6 +206,21 @@ > return 1; > } > >+static int _split_mdas(struct volume_group *vg_from, >+ struct volume_group *vg_to) >+{ >+ /* Move proper mdas to vg_to */ >+ vg_split_mdas(vg_from, &vg_from->fid->metadata_areas, &vg_to->fid->metadata_areas); >+ >+ if (list_empty(&vg_from->fid->metadata_areas) || >+ list_empty(&vg_to->fid->metadata_areas)) { >+ log_error("Cannot split - all metadata areas belong to one vg."); >+ return 0; >+ } >+ >+ return 1; >+} >+ > int vgsplit(struct cmd_context *cmd, int argc, char **argv) > { > char *vg_name_from, *vg_name_to; >@@ -330,11 +345,9 @@ > if (!(_move_mirrors(vg_from, vg_to))) > goto error; > >- /* FIXME Split mdas properly somehow too! */ >- /* Currently we cheat by sharing the format instance and relying on >- * vg_write to ignore mdas outside the VG! Done this way, with text >- * format, vg_from disappears for a short time. */ >- vg_to->fid = vg_from->fid; >+ /* Split metadata areas and check if both vgs have at least one area */ >+ if (!(_split_mdas(vg_from, vg_to))) >+ goto error; > > /* store it on disks */ > log_verbose("Writing out updated volume groups");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202885
: 150473