Whamcloud - gitweb
LU-5997 mdd: initialize mdd's obd->obd_vars 80/12980/6
authorVladimir Saveliev <vladimir.saveliev@seagate.com>
Mon, 5 Jan 2015 15:01:53 +0000 (10:01 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 27 Jan 2015 03:11:34 +0000 (03:11 +0000)
mdd_procfs_init() initializes obd->obd_vars of not mdd's obd, but
mdt's one. Having mdd's obd->obd_vars uninitialized leads conf_param
to fail on setting mdd' parametes.

Xyratex-bug-id: MRP-2277
Signed-off-by: Vladimir Saveliev <vladimir.saveliev@seagate.com>
Change-Id: I065dc9e4577816ce08f22787116fae4f7e971db5
Reviewed-on: http://review.whamcloud.com/12980
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdd/mdd_device.c
lustre/mdd/mdd_lproc.c
lustre/tests/conf-sanity.sh

index d2d007f..71e5d13 100644 (file)
@@ -119,14 +119,22 @@ out:
 static int mdd_init0(const struct lu_env *env, struct mdd_device *mdd,
                struct lu_device_type *t, struct lustre_cfg *lcfg)
 {
 static int mdd_init0(const struct lu_env *env, struct mdd_device *mdd,
                struct lu_device_type *t, struct lustre_cfg *lcfg)
 {
-       int rc;
+       int rc = -EINVAL;
+       const char *dev;
        ENTRY;
 
        ENTRY;
 
+       dev = lustre_cfg_string(lcfg, 0);
+       if (dev == NULL)
+               RETURN(rc);
+
+       mdd->mdd_md_dev.md_lu_dev.ld_obd = class_name2obd(dev);
+       if (mdd->mdd_md_dev.md_lu_dev.ld_obd == NULL)
+               RETURN(rc);
        mdd->mdd_md_dev.md_lu_dev.ld_ops = &mdd_lu_ops;
        mdd->mdd_md_dev.md_ops = &mdd_ops;
 
        rc = mdd_connect_to_next(env, mdd, lustre_cfg_string(lcfg, 3));
        mdd->mdd_md_dev.md_lu_dev.ld_ops = &mdd_lu_ops;
        mdd->mdd_md_dev.md_ops = &mdd_ops;
 
        rc = mdd_connect_to_next(env, mdd, lustre_cfg_string(lcfg, 3));
-       if (rc)
+       if (rc != 0)
                RETURN(rc);
 
        mdd->mdd_atime_diff = MAX_ATIME_DIFF;
                RETURN(rc);
 
        mdd->mdd_atime_diff = MAX_ATIME_DIFF;
index d9174ac..7bf5e33 100644 (file)
@@ -298,7 +298,7 @@ static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
 
 int mdd_procfs_init(struct mdd_device *mdd, const char *name)
 {
 
 int mdd_procfs_init(struct mdd_device *mdd, const char *name)
 {
-       struct obd_device *obd = class_name2obd(name);
+       struct obd_device *obd = mdd2obd_dev(mdd);
        struct obd_type   *type;
        int                rc;
        ENTRY;
        struct obd_type   *type;
        int                rc;
        ENTRY;
index b88859d..60475ea 100644 (file)
@@ -1833,6 +1833,10 @@ t32_test() {
                error_noexit "Setting \"lov.stripesize\""
                return 1
        }
                error_noexit "Setting \"lov.stripesize\""
                return 1
        }
+       $r $LCTL conf_param $fsname-MDT0000.mdd.atime_diff=70 || {
+               error_noexit "Setting \"mdd.atime_diff\""
+               return 1
+       }
 
        if [ "$ff_convert" != "no" -a $(facet_fstype ost1) == "ldiskfs" ]; then
                $r $LCTL lfsck_start -M $fsname-OST0000 || {
 
        if [ "$ff_convert" != "no" -a $(facet_fstype ost1) == "ldiskfs" ]; then
                $r $LCTL lfsck_start -M $fsname-OST0000 || {