summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2010-05-27 13:12:57 +0000
committerjkar8572 <jkar8572>2010-05-27 13:12:57 +0000
commitb58944b582722dd3c56893eb4b6c8b8a0291201d (patch)
tree2e14a35553f2d7f7ee4b33724125dd5d1c513776
parent4d4237de538f7c42b157dfa0ef5d711ae72d3566 (diff)
downloadlinuxquota-b58944b582722dd3c56893eb4b6c8b8a0291201d.tar.gz
* fix repquota to get latest quota info header (Jan Kara)
-rw-r--r--Changelog1
-rw-r--r--quotaio.c9
-rw-r--r--quotaio_v1.c5
-rw-r--r--quotaio_v2.c5
4 files changed, 10 insertions, 10 deletions
diff --git a/Changelog b/Changelog
index e09275f..2c4e872 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,5 @@
Changes in quota-tools from 3.17 to 4.00-pre2
+* fix repquota to get latest quota info header (Jan Kara)
* do not count system inodes into quota for ext[234] (Jan Kara)
* improve detection of XFS kernel quota interface (Jan Kara)
* support of GFS2 filesystem (Christoph Hellwig)
diff --git a/quotaio.c b/quotaio.c
index 533b631..ee8c48a 100644
--- a/quotaio.c
+++ b/quotaio.c
@@ -147,6 +147,15 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags)
}
}
if (!QIO_ENABLED(h) || flags & IOI_OPENFILE) { /* Need to open file? */
+ if (QIO_ENABLED(h)) { /* Kernel uses same file? */
+ unsigned int cmd =
+ (kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC;
+ if (quotactl(QCMD(cmd, h->qh_type), h->qh_quotadev,
+ 0, NULL) < 0) {
+ die(4, _("Cannot sync quotas on device %s: %s\n"),
+ h->qh_quotadev, strerror(errno));
+ }
+ }
/* We still need to open file for operations like 'repquota' */
if ((fd = open(qfname, QIO_RO(h) ? O_RDONLY : O_RDWR)) < 0) {
errstr(_("Cannot open quotafile %s: %s\n"),
diff --git a/quotaio_v1.c b/quotaio_v1.c
index 0edbc16..1533ffc 100644
--- a/quotaio_v1.c
+++ b/quotaio_v1.c
@@ -348,11 +348,6 @@ static int v1_scan_dquots(struct quota_handle *h, int (*process_dquot) (struct d
struct dquot *dquot = get_empty_dquot();
qid_t id = 0;
- if (QIO_ENABLED(h)) /* Kernel uses same file? */
- if (quotactl(QCMD((kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC, h->qh_type),
- h->qh_quotadev, 0, NULL) < 0)
- die(4, _("Cannot sync quotas on device %s: %s\n"), h->qh_quotadev,
- strerror(errno));
memset(dquot, 0, sizeof(*dquot));
dquot->dq_h = h;
lseek(h->qh_fd, 0, SEEK_SET);
diff --git a/quotaio_v2.c b/quotaio_v2.c
index 2e3c725..38440e7 100644
--- a/quotaio_v2.c
+++ b/quotaio_v2.c
@@ -484,11 +484,6 @@ static int v2_commit_dquot(struct dquot *dquot, int flags)
static int v2_scan_dquots(struct quota_handle *h, int (*process_dquot) (struct dquot *, char *))
{
- if (QIO_ENABLED(h)) /* Kernel uses same file? */
- if (quotactl(QCMD((kernel_iface == IFACE_GENERIC) ? Q_SYNC : Q_6_5_SYNC, h->qh_type),
- h->qh_quotadev, 0, NULL) < 0)
- die(4, _("Cannot sync quotas on device %s: %s\n"), h->qh_quotadev,
- strerror(errno));
return qtree_scan_dquots(h, process_dquot);
}