projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b63349a
)
dm array: fix bug in growing array
author
Joe Thornber
<
[email protected]
>
Wed, 30 Oct 2013 11:19:59 +0000
(11:19 +0000)
committer
Mike Snitzer
<
[email protected]
>
Tue, 5 Nov 2013 16:20:50 +0000
(11:20 -0500)
Entries would be lost if the old tail block was partially filled.
Signed-off-by: Joe Thornber <
[email protected]
>
Signed-off-by: Mike Snitzer <
[email protected]
>
Cc:
[email protected]
# 3.9+
drivers/md/persistent-data/dm-array.c
patch
|
blob
|
history
diff --git
a/drivers/md/persistent-data/dm-array.c
b/drivers/md/persistent-data/dm-array.c
index 172147eb1d4065f55805b0ff6bf77e972e9b28e3..af96e24ec3280ff9c29a7b7f13fde6fc4ba43e52 100644
(file)
--- a/
drivers/md/persistent-data/dm-array.c
+++ b/
drivers/md/persistent-data/dm-array.c
@@
-509,15
+509,18
@@
static int grow_add_tail_block(struct resize *resize)
static int grow_needs_more_blocks(struct resize *resize)
{
int r;
+ unsigned old_nr_blocks = resize->old_nr_full_blocks;
if (resize->old_nr_entries_in_last_block > 0) {
+ old_nr_blocks++;
+
r = grow_extend_tail_block(resize, resize->max_entries);
if (r)
return r;
}
r = insert_full_ablocks(resize->info, resize->size_of_block,
-
resize->old_nr_full
_blocks,
+
old_nr
_blocks,
resize->new_nr_full_blocks,
resize->max_entries, resize->value,
&resize->root);