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 146726 Details for
Bug 202826
vgsplit is broken with mirrors
[?]
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 fix
lvm2-vgsplit-mirror.patch (text/plain), 2.02 KB, created by
Milan Broz
on 2007-01-26 22:46:07 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Milan Broz
Created:
2007-01-26 22:46:07 UTC
Size:
2.02 KB
patch
obsolete
>Index: tools/vgsplit.c >=================================================================== >RCS file: /cvs/lvm2/LVM2/tools/vgsplit.c,v >retrieving revision 1.21 >diff -u -p -r1.21 vgsplit.c >--- tools/vgsplit.c 9 Jan 2007 21:12:41 -0000 1.21 >+++ tools/vgsplit.c 26 Jan 2007 21:49:19 -0000 >@@ -72,6 +72,9 @@ static int _move_lvs(struct volume_group > if ((lv->status & SNAPSHOT)) > continue; > >+ if ((lv->status & MIRRORED)) >+ continue; >+ > /* Ensure all the PVs used by this LV remain in the same */ > /* VG as each other */ > vg_with = NULL; >@@ -161,6 +164,48 @@ static int _move_snapshots(struct volume > return 1; > } > >+static int _move_mirrors(struct volume_group *vg_from, >+ struct volume_group *vg_to) >+{ >+ struct list *lvh, *lvht; >+ struct logical_volume *lv; >+ struct lv_segment *seg; >+ int i, seg_in, log_in; >+ >+ list_iterate_safe(lvh, lvht, &vg_from->lvs) { >+ lv = list_item(lvh, struct lv_list)->lv; >+ >+ if (!(lv->status & MIRRORED)) >+ continue; >+ >+ seg = first_seg(lv); >+ >+ seg_in = 0; >+ for (i = 0; i < seg->area_count; i++) >+ if (_lv_is_in_vg(vg_to, seg_lv(seg, i))) >+ seg_in++; >+ >+ log_in = (!seg->log_lv || _lv_is_in_vg(vg_to, seg->log_lv)); >+ >+ if ((seg_in && seg_in < seg->area_count) || >+ (seg_in && seg->log_lv && !log_in) || >+ (!seg_in && seg->log_lv && log_in)) { >+ log_error("Mirror %s split", lv->name); >+ return 0; >+ } >+ >+ if (seg_in == seg->area_count && log_in) { >+ list_del(lvh); >+ list_add(&vg_to->lvs, lvh); >+ >+ vg_from->lv_count--; >+ vg_to->lv_count++; >+ } >+ } >+ >+ return 1; >+} >+ > int vgsplit(struct cmd_context *cmd, int argc, char **argv) > { > char *vg_name_from, *vg_name_to; >@@ -275,6 +320,10 @@ int vgsplit(struct cmd_context *cmd, int > if (!(_move_snapshots(vg_from, vg_to))) > goto error; > >+ /* Move required mirrors across */ >+ 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
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 202826
: 146726