2.4.36-stable kernel tree
Revision | c2afbe1daf23e6501914d1ea294660a47ed6172e (tree) |
---|---|
Zeit | 2007-06-06 15:29:49 |
Autor | Willy Tarreau <w@1wt....> |
Commiter | Willy Tarreau |
[PATCH] lvm: do not update extent count if snapshot allocation fails
Fix from RHEL3 U8, explained by Heinz Mauelshagen :
That change makes sure that the extent count *only* gets updated in
case the allocation of the snapshot succeeds. Like you said: proper
error path handling.
@@ -2187,10 +2187,6 @@ static int lvm_do_lv_create(int minor, char *lv_name, lv_t * lv) | ||
2187 | 2187 | lv_ptr->lv_stripesize = |
2188 | 2188 | lv_ptr->lv_snapshot_org->lv_stripesize; |
2189 | 2189 | |
2190 | - /* Update the VG PE(s) used by snapshot reserve space. */ | |
2191 | - vg_ptr->pe_allocated += | |
2192 | - lv_ptr->lv_allocated_snapshot_le; | |
2193 | - | |
2194 | 2190 | if ((ret = |
2195 | 2191 | lvm_snapshot_alloc(lv_ptr)) != 0) { |
2196 | 2192 | vfree(lv_ptr->lv_block_exception); |
@@ -2198,6 +2194,10 @@ static int lvm_do_lv_create(int minor, char *lv_name, lv_t * lv) | ||
2198 | 2194 | vg_ptr->lv[l] = NULL; |
2199 | 2195 | return ret; |
2200 | 2196 | } |
2197 | + /* Update the VG PE(s) used by snapshot reserve space. */ | |
2198 | + vg_ptr->pe_allocated += | |
2199 | + lv_ptr->lv_allocated_snapshot_le; | |
2200 | + | |
2201 | 2201 | for (e = 0; e < lv_ptr->lv_remap_ptr; e++) |
2202 | 2202 | lvm_hash_link(lv_ptr-> |
2203 | 2203 | lv_block_exception + |