Initialize vfsold block and inode value boundries for new quota file

Part of bug #668688.
This commit is contained in:
Petr Písař 2011-02-09 15:59:24 +01:00
parent 7982b26aea
commit 30fd974858
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,32 @@
From 7313d70407961939fda2b46c7d3c00cc98fe412e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 9 Feb 2011 15:40:08 +0100
Subject: [PATCH] Initialize vfsold block and inode value boundries for new quota file
Otherwise `quotackech -c -F vfsold' fails with `Trying to set quota
usage out of range supported by quota format on...' because initial
boundry is zero.
Fixes SF bug #3176326.
---
quotaio_v1.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/quotaio_v1.c b/quotaio_v1.c
index 305bff2..61bd93e 100644
--- a/quotaio_v1.c
+++ b/quotaio_v1.c
@@ -195,6 +195,10 @@ static int v1_new_io(struct quota_handle *h)
ddqblk.dqb_itime = MAX_IQ_TIME;
h->qh_info.dqi_bgrace = MAX_DQ_TIME;
h->qh_info.dqi_igrace = MAX_IQ_TIME;
+ h->qh_info.dqi_max_b_limit = ~(uint32_t)0;
+ h->qh_info.dqi_max_i_limit = ~(uint32_t)0;
+ h->qh_info.dqi_max_b_usage = ((uint64_t)(~(uint32_t)0)) << V1_DQBLK_SIZE_BITS;
+ h->qh_info.dqi_max_i_usage = ~(uint32_t)0;
lseek(h->qh_fd, 0, SEEK_SET);
if (write(h->qh_fd, &ddqblk, sizeof(ddqblk)) != sizeof(ddqblk))
return -1;
--
1.7.4

View File

@ -5,7 +5,7 @@ Name: quota
Summary: System administration tools for monitoring users' disk usage
Epoch: 1
Version: 4.00
Release: 0.7.pre1%{?dist}
Release: 0.8.pre1%{?dist}
License: BSD and GPLv2+
URL: http://sourceforge.net/projects/linuxquota/
Group: System Environment/Base
@ -58,6 +58,8 @@ Patch19: quota-4.00_pre1-Store-PID-of-quota_nld.patch
Patch20: quota-4.00_pre1-Add-quotasync-tool.patch
# Bug #596794, in upstream 4.00_pre2
Patch21: quota-4.00_pre1-Implement-quotacheck-for-GFS2.patch
# Bug 668688, submitted to upstream
Patch22: quota-4.00_pre1-Initialize-vfsold-block-and-inode-value-boundries-fo.patch
%description
The quota package contains system administration tools for monitoring
@ -149,6 +151,7 @@ Linux/UNIX environment.
%patch19 -p1 -b .store_pid
%patch20 -p1 -b .add_quotasync
%patch21 -p1 -b .gfs2_quotacheck
%patch22 -p1 -b .inizialize_vfsold_boundries
# quotactl(2) moved into `man-pages' package (bug #640590)
rm -f quotactl.2
# remove VCS files
@ -271,6 +274,10 @@ rm -rf %{buildroot}
%changelog
* Wed Feb 09 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.8.pre1
- Initialize vfsold block and inode value boundries for new quota file
(bug #668688)
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.00-0.7.pre1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild