[RHEL8,COMMIT] ploop: Initialize is_raw on snapshot creation

Submitted by Konstantin Khorenko on Dec. 10, 2019, 3:44 p.m.


Message ID 201912101544.xBAFiPVv024220@finist_co8.work.ct
State New
Series "ploop: Initialize is_raw on snapshot creation"
Headers show

Commit Message

Konstantin Khorenko Dec. 10, 2019, 3:44 p.m.
The commit is pushed to "branch-rh8-4.18.0-80.1.2.vz8.2.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-80.1.2.vz8.2.6
commit 32e7f7fbbd20973052efb71719a684fcf0f38f71
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Tue Dec 10 18:44:25 2019 +0300

    ploop: Initialize is_raw on snapshot creation
    Here is missed initialization of is_raw, so it may
    contain 1, since we use simple kmalloc.
    Fixes: 1e2ff6152061 ("ploop: Save info about ploop->deltas[0]
    (base image) is raw")
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
 drivers/md/dm-ploop-cmd.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index 590edbfeb132..30cb4f7fbfc4 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -1037,6 +1037,7 @@  static int ploop_switch_top_delta(struct ploop *ploop, int new_ro_fd,
 	size -= sizeof(struct ploop_delta);
 	memcpy(cmd.switch_top_delta.deltas, ploop->deltas, size);
 	cmd.switch_top_delta.deltas[ploop->nr_deltas].file = file;
+	cmd.switch_top_delta.deltas[ploop->nr_deltas].is_raw = false;
 	ploop_queue_deferred_cmd(ploop, &cmd);