3972886
From e482f256411dba6a9d647e6df7f24eef8af3d59b Mon Sep 17 00:00:00 2001
3972886
From: Petr Pisar <ppisar@redhat.com>
3972886
Date: Thu, 7 Apr 2011 16:26:51 +0200
3972886
Subject: [PATCH] Initialize v2r1 ddquot padding in dump
3972886
3972886
v2r1_mem2diskdqblk() that writes quota structure into memory block
3972886
calls tree_entry_unused() to decide the structure is in use (and
3972886
rewrites UID then). However tree_entry_unused() scan can be spoiled
3972886
because padding is not initialized and contains random value.
3972886
3972886
Signed-off-by: Jan Kara <jack@suse.cz>
3972886
---
3972886
 quotaio_v2.c |    1 +
3972886
 1 files changed, 1 insertions(+), 0 deletions(-)
3972886
3972886
diff --git a/quotaio_v2.c b/quotaio_v2.c
3972886
index 2242c88..06be04e 100644
3972886
--- a/quotaio_v2.c
3972886
+++ b/quotaio_v2.c
3972886
@@ -144,6 +144,7 @@ static void v2r1_mem2diskdqblk(void *dp, struct dquot *dquot)
3972886
 	d->dqb_itime = __cpu_to_le64(m->dqb_itime);
3972886
 	d->dqb_btime = __cpu_to_le64(m->dqb_btime);
3972886
 	d->dqb_id = __cpu_to_le32(dquot->dq_id);
3972886
+	d->dqb_pad = 0;     /* Initialize because of qtree_entry_unused() scan */
3972886
 	if (qtree_entry_unused(&dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree, dp))
3972886
 		d->dqb_itime = __cpu_to_le64(1);
3972886
 }
3972886
-- 
3972886
1.7.4.2
3972886