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

cleanup: check pv_count is not 0

Since we already detect writemostly_ARG is non-zero
make it obvious pv_count will also be non-zero in this case.
This commit is contained in:
Zdenek Kabelac 2014-08-21 15:38:18 +02:00
parent 3b5afac9b4
commit 24001a08ab

View File

@ -740,9 +740,8 @@ static int lvchange_writemostly(struct logical_volume *lv)
if (arg_count(cmd, writebehind_ARG))
raid_seg->writebehind = arg_uint_value(cmd, writebehind_ARG, 0);
if (arg_count(cmd, writemostly_ARG)) {
if ((pv_count = arg_count(cmd, writemostly_ARG))) {
/* writemostly can be specified more than once */
pv_count = arg_count(cmd, writemostly_ARG);
pv_names = dm_pool_alloc(lv->vg->vgmem, sizeof(char *) * pv_count);
if (!pv_names)
return_0;