[RH7] ploop: Reread bat offsets and length before merge

Submitted by Kirill Tkhai on Dec. 17, 2019, 8:58 a.m.

Details

Message ID 157657311600.120079.9556110802010643261.stgit@localhost.localdomain
State New
Series "ploop: Reread bat offsets and length before merge"
Headers show

Commit Message

Kirill Tkhai Dec. 17, 2019, 8:58 a.m.
New top delta may growth. This time base delta's
BAT may be updated from userspace, so we have to
reread new position of holes.

https://jira.sw.ru/browse/PSBM-100441

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 drivers/block/ploop/fmt_ploop1.c |    2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
index 981978c0ee4a..280767f59995 100644
--- a/drivers/block/ploop/fmt_ploop1.c
+++ b/drivers/block/ploop/fmt_ploop1.c
@@ -598,6 +598,8 @@  ploop1_start_merge(struct ploop_delta * delta, struct ploop_snapdata * sd)
 		return err;
 
 	ph->bd_size = get_SizeInSectors_from_le(vh, delta->plo->fmt_version);
+	ph->l1_off = le32_to_cpu(vh->m_FirstBlockOffset);
+	ph->nr_bat_entries = le32_to_cpu(vh->m_Size);
 
 	err = delta->io.ops->sync(&delta->io);
 	if (err)