mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Change lvchange exit status to indicate if any part of the operation failed.
This commit is contained in:
parent
a6d9d66dcc
commit
021317a547
@ -1,5 +1,6 @@
|
||||
Version 2.02.40 -
|
||||
================================
|
||||
Change lvchange exit status to indicate if any part of the operation failed.
|
||||
Fix pvchange and pvremove to handle PVs without mdas.
|
||||
Refactor _text_pv_read and always return mda list if requested.
|
||||
Fix configure to work w/o readline unless --enable-readline used. (2.02.39)
|
||||
|
@ -545,7 +545,7 @@ static int lvchange_tag(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
void *handle __attribute((unused)))
|
||||
{
|
||||
int doit = 0;
|
||||
int doit = 0, docmds = 0;
|
||||
int archived = 0;
|
||||
|
||||
if (!(lv->vg->status & LVM_WRITE) &&
|
||||
@ -606,6 +606,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_permission(cmd, lv);
|
||||
docmds++;
|
||||
}
|
||||
|
||||
/* allocation policy change */
|
||||
@ -614,6 +615,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_alloc(cmd, lv);
|
||||
docmds++;
|
||||
}
|
||||
|
||||
/* read ahead sector change */
|
||||
@ -622,6 +624,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_readahead(cmd, lv);
|
||||
docmds++;
|
||||
}
|
||||
|
||||
/* read ahead sector change */
|
||||
@ -630,6 +633,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_persistent(cmd, lv);
|
||||
docmds++;
|
||||
if (sigint_caught())
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
@ -640,6 +644,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_tag(cmd, lv, addtag_ARG);
|
||||
docmds++;
|
||||
}
|
||||
|
||||
/* del tag */
|
||||
@ -648,6 +653,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
archived = 1;
|
||||
doit += lvchange_tag(cmd, lv, deltag_ARG);
|
||||
docmds++;
|
||||
}
|
||||
|
||||
if (doit)
|
||||
@ -674,6 +680,9 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (doit != docmds)
|
||||
return ECMD_FAILED;
|
||||
|
||||
return ECMD_PROCESSED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user