Whamcloud - gitweb
b=20997 passthrough obd_force from lmv to mdc
[fs/lustre-release.git] / lustre / lov / lov_obd.c
index 0ae54ea..c13ccaf 100644 (file)
@@ -815,12 +815,10 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         lov->lov_pool_count = 0;
         rc = lov_ost_pool_init(&lov->lov_packed, 0);
         if (rc)
-                RETURN(rc);
+                GOTO(out_free_statfs, rc);
         rc = lov_ost_pool_init(&lov->lov_qos.lq_rr.lqr_pool, 0);
-        if (rc) {
-                lov_ost_pool_free(&lov->lov_packed);
-                RETURN(rc);
-        }
+        if (rc)
+                GOTO(out_free_lov_packed, rc);
 
         lprocfs_lov_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
@@ -839,6 +837,12 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                                     NULL, NULL);
 
         RETURN(0);
+
+out_free_lov_packed:
+        lov_ost_pool_free(&lov->lov_packed);
+out_free_statfs:
+        OBD_FREE_PTR(lov->lov_qos.lq_statfs_data);
+        return rc;
 }
 
 static int lov_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
@@ -2133,11 +2137,16 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
                 for (i = 0; i < count; i++) {
                         int err;
+                        struct obd_device *osc_obd;
 
                         /* OST was disconnected */
                         if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_exp)
                                 continue;
 
+                        /* ll_umount_begin() sets force flag but for lov, not
+                         * osc. Let's pass it through */
+                        osc_obd = class_exp2obd(lov->lov_tgts[i]->ltd_exp);
+                        osc_obd->obd_force = obddev->obd_force;
                         err = obd_iocontrol(cmd, lov->lov_tgts[i]->ltd_exp,
                                             len, karg, uarg);
                         if (err == -ENODATA && cmd == OBD_IOC_POLL_QUOTACHECK) {