summaryrefslogtreecommitdiff
path: root/quotasys.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2010-06-14 12:42:57 +0000
committerjkar8572 <jkar8572>2010-06-14 12:42:57 +0000
commit86b82591a57198dbe88f5b37402f299a424e1b57 (patch)
treec5c51996de35d409821dd2928e2f0aaf3db1e9d0 /quotasys.c
parent22418226016a589a2ea355f1965f4123276e6bb8 (diff)
Fix kern_quota_on() to work with XFS filesystems (Jan Kara)
Fix quotaon to work correctly with XFS filesystems (Jan Kara)
Diffstat (limited to 'quotasys.c')
-rw-r--r--quotasys.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/quotasys.c b/quotasys.c
index 5b6996c..9bc63b5 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -861,22 +861,23 @@ int kern_quota_on(const char *dev, int type, int fmt)
if (kernel_iface == IFACE_GENERIC) {
int actfmt;
- if (quotactl(QCMD(Q_GETFMT, type), dev, 0, (void *)&actfmt) < 0)
- return -1;
- actfmt = kern2utilfmt(actfmt);
- if (actfmt < 0)
- return -1;
- return actfmt;
+ if (quotactl(QCMD(Q_GETFMT, type), dev, 0,
+ (void *)&actfmt) >= 0) {
+ actfmt = kern2utilfmt(actfmt);
+ if (actfmt >= 0)
+ return actfmt;
+ }
+ } else {
+ if ((fmt == -1 || fmt == QF_VFSV0) &&
+ v2_kern_quota_on(dev, type)) /* VFSv0 quota format */
+ return QF_VFSV0;
+ if ((fmt == -1 || fmt == QF_VFSOLD) &&
+ v1_kern_quota_on(dev, type)) /* Old quota format */
+ return QF_VFSOLD;
}
- if ((fmt == -1 || fmt == QF_VFSV0) &&
- v2_kern_quota_on(dev, type)) /* VFSv0 quota format */
- return QF_VFSV0;
if ((fmt == -1 || fmt == QF_XFS) &&
xfs_kern_quota_on(dev, type)) /* XFS quota format */
return QF_XFS;
- if ((fmt == -1 || fmt == QF_VFSOLD) &&
- v1_kern_quota_on(dev, type)) /* Old quota format */
- return QF_VFSOLD;
return -1;
}