summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2002-03-01 10:59:54 +0000
committerjkar8572 <jkar8572>2002-03-01 10:59:54 +0000
commitf8cc5d8896dc5f069d1bc0376fee6b732568bb59 (patch)
tree30641899124452d63c77d3fdd7940fcc3efe9b55
parent9f04804a8da0547a6d6d18bbd83501a5db164e1a (diff)
Small formatting change in quotactl.2 (Nathan Scott)
Make init_io() more paranoid about quota turned on in kernel (Jan Kara)
-rw-r--r--Changelog1
-rw-r--r--quotactl.23
-rw-r--r--quotaio.c18
3 files changed, 15 insertions, 7 deletions
diff --git a/Changelog b/Changelog
index 3974fcd..7d56e07 100644
--- a/Changelog
+++ b/Changelog
@@ -9,6 +9,7 @@ Changes in quota-tools from 3.03 to 3.04
* ignore automount mountpoints (Philippe Troin)
* fixed minor bug in printing grace times (Jan Kara)
* fixed quotaon(8) behaviour when it sees newer kernel then it's able to handle (Jan Kara)
+* minor formatting change in quotactl(2) manpage (Nathan Scott)
Changes in quota-tools from 3.02 to 3.03
diff --git a/quotactl.2 b/quotactl.2
index e3fb145..7b66f2e 100644
--- a/quotactl.2
+++ b/quotactl.2
@@ -156,8 +156,7 @@ structure (defined in
.I id
is ignored. This operation is restricted to super-user.
.TP
-For XFS filesystems making use of the XFS Quota Manager (XQM), the
-above commands are bypassed and the following commands are used:
+For XFS filesystems making use of the XFS Quota Manager (XQM), the above commands are bypassed and the following commands are used:
.TP 15
.SB Q_XQUOTAON
Turn on quotas for an XFS filesystem.
diff --git a/quotaio.c b/quotaio.c
index 6478ad9..3efda67 100644
--- a/quotaio.c
+++ b/quotaio.c
@@ -108,11 +108,19 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags)
return h;
}
kernfmt = kern_quota_format(); /* Check kernel quota format */
- if (kernfmt > 0 && (fmt == -1 || (1 << fmt) & kernfmt) && /* Quota compiled and desired format available? */
- /* Quota turned on? */
- (kernfmt = kern_quota_on(h->qh_quotadev, type, fmt == -1 ? kernfmt : (1 << fmt))) != -1) {
- h->qh_io_flags |= IOFL_QUOTAON;
- fmt = kernfmt; /* Default is kernel used format */
+ if (kernfmt == QF_TOONEW || kernfmt > 0) {
+ /* Try whether some quota isn't turned on */
+ if (fmt != -1) {
+ if (kern_quota_on(h->qh_quotadev, type, 1 << fmt) != -1)
+ h->qh_io_flags |= IOFL_QUOTAON;
+ }
+ else if (kernfmt == QF_TOONEW) {
+ if ((fmt = kern_quota_on(h->qh_quotadev, type, (1 << QF_VFSOLD) | (1 << QF_VFSV0))) != -1)
+ h->qh_io_flags |= IOFL_QUOTAON;
+ }
+ else
+ if ((fmt = kern_quota_on(h->qh_quotadev, type, kernfmt)) != -1)
+ h->qh_io_flags |= IOFL_QUOTAON;
}
if (!(qfname = get_qf_name(mnt, type, fmt))) {
errstr(_("Can't get quotafile name.\n"));