[Devel] [PATCH RH8] dm-ploop: Actually zero tail of tail page
Kirill Tkhai
ktkhai at virtuozzo.com
Wed Dec 16 19:13:53 MSK 2020
@from is temporary buffer. We have to zero tail of @to instead.
https://jira.sw.ru/browse/PSBM-123784
Fixes: 0497d745e201 "ploop: Zero tail of tail page"
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/md/dm-ploop-bat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-ploop-bat.c b/drivers/md/dm-ploop-bat.c
index da18dd2e4638..3fcdf248c490 100644
--- a/drivers/md/dm-ploop-bat.c
+++ b/drivers/md/dm-ploop-bat.c
@@ -169,7 +169,7 @@ static int ploop_read_bat(struct ploop *ploop, struct bio *bio)
memcpy(to, from, nr_copy * sizeof(map_index_t));
kunmap(bio->bi_io_vec[page].bv_page);
if (unlikely(nr_copy < BAT_ENTRIES_PER_PAGE)) {
- memset(from + nr_copy, 0, sizeof(map_index_t) *
+ memset(to + nr_copy, 0, sizeof(map_index_t) *
(BAT_ENTRIES_PER_PAGE - nr_copy));
}
More information about the Devel
mailing list