Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b=1028 drop SOM dependency on quota
[fs/lustre-release.git]
/
lustre
/
quota
/
lproc_quota.c
diff --git
a/lustre/quota/lproc_quota.c
b/lustre/quota/lproc_quota.c
index
ce0f8ba
..
d911365
100644
(file)
--- a/
lustre/quota/lproc_quota.c
+++ b/
lustre/quota/lproc_quota.c
@@
-219,18
+219,12
@@
static int auto_quota_on(struct obd_device *obd, int type,
if (!oqctl)
RETURN(-ENOMEM);
if (!oqctl)
RETURN(-ENOMEM);
- down(&obt->obt_quotachecking);
+
cfs_
down(&obt->obt_quotachecking);
id = UGQUOTA2LQC(type);
/* quota already turned on */
if ((obt->obt_qctxt.lqc_flags & id) == id)
GOTO(out, rc);
id = UGQUOTA2LQC(type);
/* quota already turned on */
if ((obt->obt_qctxt.lqc_flags & id) == id)
GOTO(out, rc);
- if (obt->obt_qctxt.lqc_immutable) {
- LCONSOLE_ERROR("Failed to turn Quota on, immutable mode "
- "(is SOM enabled?)\n");
- GOTO(out, rc = -ECANCELED);
- }
-
oqctl->qc_type = type;
oqctl->qc_cmd = Q_QUOTAON;
oqctl->qc_id = obt->obt_qfmt;
oqctl->qc_type = type;
oqctl->qc_cmd = Q_QUOTAON;
oqctl->qc_id = obt->obt_qfmt;
@@
-239,12
+233,13
@@
static int auto_quota_on(struct obd_device *obd, int type,
if (is_master) {
mds = &obd->u.mds;
if (is_master) {
mds = &obd->u.mds;
- down(&mds->mds_qonoff_sem);
+
cfs_
down(&mds->mds_qonoff_sem);
/* turn on cluster wide quota */
rc1 = mds_admin_quota_on(obd, oqctl);
if (rc1 && rc1 != -EALREADY) {
/* turn on cluster wide quota */
rc1 = mds_admin_quota_on(obd, oqctl);
if (rc1 && rc1 != -EALREADY) {
- CDEBUG(rc1 == -ENOENT ? D_QUOTA : D_ERROR,
- "auto-enable admin quota failed. rc=%d\n", rc1);
+ CDEBUG_LIMIT(rc1 == -ENOENT ? D_QUOTA : D_ERROR,
+ "%s: auto-enable admin quota failed with "
+ "rc=%d\n", obd->obd_name, rc1);
GOTO(out_ctxt, rc1);
}
}
GOTO(out_ctxt, rc1);
}
}
@@
-255,15
+250,22
@@
static int auto_quota_on(struct obd_device *obd, int type,
obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(type);
build_lqs(obd);
} else if (rc == -EBUSY && quota_is_on(qctxt, oqctl)) {
obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(type);
build_lqs(obd);
} else if (rc == -EBUSY && quota_is_on(qctxt, oqctl)) {
- CWARN("mds local quota[%d] is on already\n", oqctl->qc_type);
+ CWARN("%s: mds local quota[%d] is on already\n",
+ obd->obd_name, oqctl->qc_type);
rc = -EALREADY;
} else {
rc = -EALREADY;
} else {
- CDEBUG(rc == -ENOENT ? D_QUOTA : D_ERROR,
- "auto-enable local quota failed. rc=%d\n", rc);
+ CDEBUG_LIMIT(rc == -ENOENT ? D_QUOTA : D_ERROR,
+ "%s: auto-enable local quota failed with rc=%d\n",
+ obd->obd_name, rc);
if (rc1 == -EALREADY) {
oqctl->qc_cmd = Q_QUOTAOFF;
mds_admin_quota_off(obd, oqctl);
}
if (rc1 == -EALREADY) {
oqctl->qc_cmd = Q_QUOTAOFF;
mds_admin_quota_off(obd, oqctl);
}
+ if (rc == -ENOENT)
+ CWARN("%s: quotaon failed because quota files don't "
+ "exist, please run quotacheck firstly\n",
+ obd->obd_name);
+
GOTO(out_ctxt, rc);
}
GOTO(out_ctxt, rc);
}
@@
-271,11
+273,11
@@
static int auto_quota_on(struct obd_device *obd, int type,
out_ctxt:
if (mds != NULL)
out_ctxt:
if (mds != NULL)
- up(&mds->mds_qonoff_sem);
+
cfs_
up(&mds->mds_qonoff_sem);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
out:
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
out:
- up(&obt->obt_quotachecking);
+
cfs_
up(&obt->obt_quotachecking);
OBD_FREE_PTR(oqctl);
return rc;
}
OBD_FREE_PTR(oqctl);
return rc;
}
@@
-298,7
+300,7
@@
int lprocfs_quota_wr_type(struct file *file, const char *buffer,
if (count > MAX_STYPE_SIZE)
return -EINVAL;
if (count > MAX_STYPE_SIZE)
return -EINVAL;
- if (copy_from_user(stype, buffer, count))
+ if (c
fs_c
opy_from_user(stype, buffer, count))
return -EFAULT;
for (i = 0 ; i < count ; i++) {
return -EFAULT;
for (i = 0 ; i < count ; i++) {
@@
-323,7
+325,7
@@
int lprocfs_quota_wr_type(struct file *file, const char *buffer,
if (type != 0) {
int rc = auto_quota_on(obd, type - 1, obt->obt_sb, is_mds);
if (type != 0) {
int rc = auto_quota_on(obd, type - 1, obt->obt_sb, is_mds);
- if (rc && rc != -EALREADY)
+ if (rc && rc != -EALREADY
&& rc != -ENOENT
)
return rc;
}
return rc;
}
@@
-592,8
+594,8
@@
int lquota_proc_setup(struct obd_device *obd, int is_master)
lprocfs_quota_common_vars, obd);
if (IS_ERR(qctxt->lqc_proc_dir)) {
rc = PTR_ERR(qctxt->lqc_proc_dir);
lprocfs_quota_common_vars, obd);
if (IS_ERR(qctxt->lqc_proc_dir)) {
rc = PTR_ERR(qctxt->lqc_proc_dir);
- CERROR("
error %d setting up lprocfs for %s\n", rc
,
- obd->obd_name);
+ CERROR("
%s: error %d setting up lprocfs\n"
,
+ obd->obd_name
, rc
);
qctxt->lqc_proc_dir = NULL;
GOTO(out, rc);
}
qctxt->lqc_proc_dir = NULL;
GOTO(out, rc);
}
@@
-602,8
+604,8
@@
int lquota_proc_setup(struct obd_device *obd, int is_master)
rc = lprocfs_add_vars(qctxt->lqc_proc_dir,
lprocfs_quota_master_vars, obd);
if (rc) {
rc = lprocfs_add_vars(qctxt->lqc_proc_dir,
lprocfs_quota_master_vars, obd);
if (rc) {
- CERROR("
error %d setting up lprocfs for %s
"
- "
(quota master)\n", rc, obd->obd_name
);
+ CERROR("
%s: error %d setting up lprocfs for
"
+ "
quota master\n", obd->obd_name, rc
);
GOTO(out_free_proc, rc);
}
}
GOTO(out_free_proc, rc);
}
}