Whamcloud - gitweb
LU-717 ldiskfs: MRP-222 Replace sysname with nodename in MMP
[fs/lustre-release.git] / lustre / quota / quota_check.c
index c6e8daa..599ea4c 100644 (file)
@@ -174,8 +174,8 @@ int target_quota_check(struct obd_device *obd, struct obd_export *exp,
         /* we get ref for exp because target_quotacheck_callback() will use this
          * export later b=18126 */
         class_export_get(exp);
-        rc = cfs_kernel_thread(target_quotacheck_thread, qta,
-                               CLONE_VM|CLONE_FILES);
+        rc = cfs_create_thread(target_quotacheck_thread, qta,
+                               CFS_DAEMON_FLAGS);
         if (rc >= 0) {
                 /* target_quotacheck_thread will drop the ref on exp and release
                  * obt_quotachecking */
@@ -301,7 +301,17 @@ int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
         obd_getref(obd);
 
         for (i = 0; i < lov->desc.ld_tgt_count; i++) {
-                if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) {
+                if (!lov->lov_tgts[i])
+                        continue;
+
+                /* Skip quota check on the administratively disabled OSTs. */
+                if (!lov->lov_tgts[i]->ltd_activate) {
+                        CWARN("lov idx %d was administratively disabled, "
+                              "skip quotacheck on it.\n", i);
+                        continue;
+                }
+
+                if (!lov->lov_tgts[i]->ltd_active) {
                         CERROR("lov idx %d inactive\n", i);
                         rc = -EIO;
                         goto out;
@@ -311,6 +321,9 @@ int lov_quota_check(struct obd_device *unused, struct obd_export *exp,
         for (i = 0; i < lov->desc.ld_tgt_count; i++) {
                 int err;
 
+                if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_activate)
+                        continue;
+
                 err = obd_quotacheck(lov->lov_tgts[i]->ltd_exp, oqctl);
                 if (err && !rc)
                         rc = err;