diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-11-02 20:40:05 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-11-02 20:40:05 +0000 |
commit | d38bf3616cc3ec1675894cb012297795897c1b50 (patch) | |
tree | 2b1113859a8d4fc47a8464cfdaaf0a6616c1ada2 /tools/vgcfgrestore.c | |
parent | 9c1dbeb3f18b34de8199e4a31d2465dd3b9624f4 (diff) | |
download | lvm2-d38bf3616cc3ec1675894cb012297795897c1b50.tar.gz lvm2-d38bf3616cc3ec1675894cb012297795897c1b50.tar.xz lvm2-d38bf3616cc3ec1675894cb012297795897c1b50.zip |
Fix orphan-related locking in pvdisplay and pvs.
Fix missing VG unlocks in some pvchange error paths.
Add some missing validation of VG names.
Rename validate_vg_name() to validate_new_vg_name().
Change orphan lock to VG_ORPHANS.
Change format1 to use ORPHAN as orphan VG name.
Diffstat (limited to 'tools/vgcfgrestore.c')
-rw-r--r-- | tools/vgcfgrestore.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c index 87e8023c..a19369e6 100644 --- a/tools/vgcfgrestore.c +++ b/tools/vgcfgrestore.c @@ -43,14 +43,14 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv) return ECMD_PROCESSED; } - if (!lock_vol(cmd, ORPHAN, LCK_VG_WRITE)) { + if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) { log_error("Unable to lock orphans"); return ECMD_FAILED; } if (!lock_vol(cmd, vg_name, LCK_VG_WRITE | LCK_NONBLOCK)) { log_error("Unable to lock volume group %s", vg_name); - unlock_vg(cmd, ORPHAN); + unlock_vg(cmd, VG_ORPHANS); return ECMD_FAILED; } @@ -59,7 +59,7 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv) arg_str_value(cmd, file_ARG, "")) : backup_restore(cmd, vg_name))) { unlock_vg(cmd, vg_name); - unlock_vg(cmd, ORPHAN); + unlock_vg(cmd, VG_ORPHANS); log_err("Restore failed."); return ECMD_FAILED; } @@ -67,6 +67,6 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv) log_print("Restored volume group %s", vg_name); unlock_vg(cmd, vg_name); - unlock_vg(cmd, ORPHAN); + unlock_vg(cmd, VG_ORPHANS); return ECMD_PROCESSED; } |