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
LU-14472 quota: skip non-exist or inact tgt for lfs_quota
[fs/lustre-release.git]
/
lustre
/
lmv
/
lmv_obd.c
diff --git
a/lustre/lmv/lmv_obd.c
b/lustre/lmv/lmv_obd.c
index
9de2f12
..
4fded87
100644
(file)
--- a/
lustre/lmv/lmv_obd.c
+++ b/
lustre/lmv/lmv_obd.c
@@
-864,6
+864,7
@@
static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
case OBD_IOC_QUOTACTL: {
struct if_quotactl *qctl = karg;
struct obd_quotactl *oqctl;
case OBD_IOC_QUOTACTL: {
struct if_quotactl *qctl = karg;
struct obd_quotactl *oqctl;
+ struct obd_import *imp;
if (qctl->qc_valid == QC_MDTIDX) {
tgt = lmv_tgt(lmv, qctl->qc_idx);
if (qctl->qc_valid == QC_MDTIDX) {
tgt = lmv_tgt(lmv, qctl->qc_idx);
@@
-882,9
+883,19
@@
static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
RETURN(-EINVAL);
}
RETURN(-EINVAL);
}
- if (!tgt || !tgt->ltd_exp)
+ if (!tgt)
+ RETURN(-ENODEV);
+
+ if (!tgt->ltd_exp)
RETURN(-EINVAL);
RETURN(-EINVAL);
+ imp = class_exp2cliimp(tgt->ltd_exp);
+ if (!tgt->ltd_active && imp->imp_state != LUSTRE_IMP_IDLE) {
+ qctl->qc_valid = QC_MDTIDX;
+ qctl->obd_uuid = tgt->ltd_uuid;
+ RETURN(-ENODATA);
+ }
+
OBD_ALLOC_PTR(oqctl);
if (!oqctl)
RETURN(-ENOMEM);
OBD_ALLOC_PTR(oqctl);
if (!oqctl)
RETURN(-ENOMEM);
@@
-3180,7
+3191,7
@@
static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
exp->exp_connect_data = *(struct obd_connect_data *)val;
RETURN(rc);
} else if (KEY_IS(KEY_TGT_COUNT)) {
exp->exp_connect_data = *(struct obd_connect_data *)val;
RETURN(rc);
} else if (KEY_IS(KEY_TGT_COUNT)) {
- *((int *)val) = lmv->lmv_mdt_descs.ltd_
lmv_desc.ld_tgt_count
;
+ *((int *)val) = lmv->lmv_mdt_descs.ltd_
tgts_size
;
RETURN(0);
}
RETURN(0);
}