diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index e6a26f4f8..06384ce85 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -68,7 +68,8 @@ struct list *find_snapshots(struct logical_volume *lv) { struct list *slh; struct list *snaplist; - struct snapshot_list *sl, *newsl; + struct snapshot *s; + struct snapshot_list *newsl; struct pool *mem = lv->vg->cmd->mem; if (!(snaplist = pool_alloc(mem, sizeof(*snaplist)))) { @@ -79,15 +80,15 @@ struct list *find_snapshots(struct logical_volume *lv) list_init(snaplist); list_iterate(slh, &lv->vg->snapshots) { - sl = list_item(slh, struct snapshot_list); - if (!(sl->snapshot->origin == lv)) + s = list_item(slh, struct snapshot_list)->snapshot; + if (!(s->origin == lv)) continue; if (!(newsl = pool_alloc(mem, sizeof(*newsl)))) { log_error("snapshot_list structure allocation failed"); pool_free(mem, snaplist); return NULL; } - newsl->snapshot = sl->snapshot; + newsl->snapshot = s; list_add(snaplist, &newsl->list); } diff --git a/lib/misc/lvm-file.c b/lib/misc/lvm-file.c index 22f94d24f..0f6c3b5c9 100644 --- a/lib/misc/lvm-file.c +++ b/lib/misc/lvm-file.c @@ -133,8 +133,9 @@ static int _create_dir_recursive(const char *dir) { char *orig, *s; int rc; - - /* create parent directories */ + + log_verbose("Creating directory \"%s\"", dir); + /* Create parent directories */ orig = s = dbg_strdup(dir); while ((s = strchr(s, '/')) != NULL) { *s = '\0'; @@ -150,8 +151,7 @@ static int _create_dir_recursive(const char *dir) } dbg_free(orig); - /* done w/ parents, create final directory */ - log_verbose("Creating directory \"%s\"", dir); + /* Create final directory */ rc = mkdir(dir, 0777); if (rc < 0 && errno != EEXIST) { log_sys_error("mkdir", dir);