|
@@ -257,6 +257,16 @@ static void pop_frame(struct del_stack *s)
|
|
|
dm_tm_unlock(s->tm, f->b);
|
|
|
}
|
|
|
|
|
|
+static void unlock_all_frames(struct del_stack *s)
|
|
|
+{
|
|
|
+ struct frame *f;
|
|
|
+
|
|
|
+ while (unprocessed_frames(s)) {
|
|
|
+ f = s->spine + s->top--;
|
|
|
+ dm_tm_unlock(s->tm, f->b);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
|
|
|
{
|
|
|
int r;
|
|
@@ -313,9 +323,13 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root)
|
|
|
pop_frame(s);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
out:
|
|
|
+ if (r) {
|
|
|
+ /* cleanup all frames of del_stack */
|
|
|
+ unlock_all_frames(s);
|
|
|
+ }
|
|
|
kfree(s);
|
|
|
+
|
|
|
return r;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(dm_btree_del);
|