From ed16933595dfbbdba0043bcb3c0f22201fd42e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 11 Apr 2011 18:28:43 +0200 Subject: [PATCH] Initialize v2r1 ddquot padding in dump --- ...itialize-v2r1-ddquot-padding-in-dump.patch | 30 +++++++++++++++++++ quota.spec | 8 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch diff --git a/quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch b/quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch new file mode 100644 index 0000000..8b7993f --- /dev/null +++ b/quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch @@ -0,0 +1,30 @@ +From e482f256411dba6a9d647e6df7f24eef8af3d59b Mon Sep 17 00:00:00 2001 +From: Petr Pisar +Date: Thu, 7 Apr 2011 16:26:51 +0200 +Subject: [PATCH] Initialize v2r1 ddquot padding in dump + +v2r1_mem2diskdqblk() that writes quota structure into memory block +calls tree_entry_unused() to decide the structure is in use (and +rewrites UID then). However tree_entry_unused() scan can be spoiled +because padding is not initialized and contains random value. + +Signed-off-by: Jan Kara +--- + quotaio_v2.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/quotaio_v2.c b/quotaio_v2.c +index 2242c88..06be04e 100644 +--- a/quotaio_v2.c ++++ b/quotaio_v2.c +@@ -144,6 +144,7 @@ static void v2r1_mem2diskdqblk(void *dp, struct dquot *dquot) + d->dqb_itime = __cpu_to_le64(m->dqb_itime); + d->dqb_btime = __cpu_to_le64(m->dqb_btime); + d->dqb_id = __cpu_to_le32(dquot->dq_id); ++ d->dqb_pad = 0; /* Initialize because of qtree_entry_unused() scan */ + if (qtree_entry_unused(&dquot->dq_h->qh_info.u.v2_mdqi.dqi_qtree, dp)) + d->dqb_itime = __cpu_to_le64(1); + } +-- +1.7.4.2 + diff --git a/quota.spec b/quota.spec index d4b9e9e..23b5f83 100644 --- a/quota.spec +++ b/quota.spec @@ -5,7 +5,7 @@ Name: quota Summary: System administration tools for monitoring users' disk usage Epoch: 1 Version: 4.00 -Release: 0.13.pre1%{?dist} +Release: 0.14.pre1%{?dist} License: BSD and GPLv2+ URL: http://sourceforge.net/projects/linuxquota/ Group: System Environment/Base @@ -76,6 +76,8 @@ Patch28: quota-4.00_pre1-Reverse-setgrace-condition.patch Patch29: quota-4.00_pre1-Fix-ddquot-buffer-leak.patch # In upstream 4.00_pre2, bug #689458 Patch30: quota-4.00_pre1-fix-repquota-to-get-latest-quota-info-header.patch +# In upstream 4.00_pre2, bug #695409 +Patch31: quota-4.00_pre1-Initialize-v2r1-ddquot-padding-in-dump.patch %description @@ -177,6 +179,7 @@ Linux/UNIX environment. %patch28 -p1 -b .reverse_setgrace_condition %patch29 -p1 -b .fix_ddquot_leak %patch30 -p1 -b .repquota_latest_info.patch +%patch31 -p1 -b .initizalize_ddquot_paddding # quotactl(2) moved into `man-pages' package (bug #640590) rm -f quotactl.2 # remove VCS files @@ -299,6 +302,9 @@ rm -rf %{buildroot} %changelog +* Mon Apr 11 2011 Petr Pisar - 1:4.00-0.14.pre1 +- Initialize v2r1 ddquot padding in dump (bug #695409) + * Mon Mar 21 2011 Petr Pisar - 1:4.00-0.13.pre1 - Fix repquota to get latest quota info header (bug #689458)