1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Add check to vg_commit() to ensure lock is held before writing new VG metadata.

This commit is contained in:
Dave Wysochanski 2008-04-04 15:41:20 +00:00
parent d2901a62a4
commit 9da5d7ac02
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.34 -
===================================
Add check to vg_commit() ensuring VG lock held before writing new VG metadata.
Add validation of LV name to pvmove -n.
Make clvmd refresh the context correctly when lvm.conf is updated.
Add some basic internal VG lock validation.

View File

@ -1316,6 +1316,12 @@ int vg_commit(struct volume_group *vg)
int cache_updated = 0;
int failed = 0;
if (!vgname_is_locked(vg->name)) {
log_error("Internal error: Attempt to write new VG metadata "
"without locking %s", vg->name);
return cache_updated;
}
/* Commit to each copy of the metadata area */
list_iterate_items(mda, &vg->fid->metadata_areas) {
failed = 0;