[RHEL8,COMMIT] dm-ploop: Actually zero tail of tail page

Submitted by Konstantin Khorenko on Dec. 17, 2020, 3:59 p.m.

Details

Message ID 202012171559.0BHFx5Ax4030524@finist-co8.sw.ru
State New
Series "dm-ploop: Actually zero tail of tail page"
Headers show

Commit Message

Konstantin Khorenko Dec. 17, 2020, 3:59 p.m.
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.2
------>
commit f9ebd8db47ba16a3d5f023172ab10fb87463bcab
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Thu Dec 17 18:59:04 2020 +0300

    dm-ploop: Actually zero tail of tail page
    
    @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));
 			}