[RH8] dm-ploop: Actually zero tail of tail page

Submitted by Kirill Tkhai on Dec. 16, 2020, 4:13 p.m.

Details

Message ID 160813513981.386976.7002484786670875464.stgit@localhost.localdomain
State New
Series "dm-ploop: Actually zero tail of tail page"
Headers show

Commit Message

Kirill Tkhai Dec. 16, 2020, 4:13 p.m.
@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@virtuozzo.com>
---
 drivers/md/dm-ploop-bat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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));
 			}