Whamcloud - gitweb
LU-8182 mdt: check connection data properly 91/20391/2
authorFan Yong <fan.yong@intel.com>
Tue, 26 Apr 2016 21:47:15 +0000 (05:47 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Jun 2016 03:55:22 +0000 (03:55 +0000)
For mdt_obd_connect() case, the parameter @data should never be
NULL, so drop the redundant check of "data != NULL", replace it
with "LASSERT(data != NULL);"

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ia6754752527e69c89e7a40d3d012232eaba94d3e
Reviewed-on: http://review.whamcloud.com/20391
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/mdt/mdt_handler.c

index a977d29..f786f00 100644 (file)
@@ -5313,6 +5313,8 @@ static int mdt_obd_connect(const struct lu_env *env,
        ENTRY;
 
        LASSERT(env != NULL);
+       LASSERT(data != NULL);
+
        if (!exp || !obd || !cluuid)
                RETURN(-EINVAL);
 
@@ -5329,7 +5331,7 @@ static int mdt_obd_connect(const struct lu_env *env,
         * XXX: probably not very appropriate method is used now
         *      at some point we should find a better one
         */
-       if (!test_bit(MDT_FL_SYNCED, &mdt->mdt_state) && data != NULL &&
+       if (!test_bit(MDT_FL_SYNCED, &mdt->mdt_state) &&
            !(data->ocd_connect_flags & OBD_CONNECT_LIGHTWEIGHT) &&
            !(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS)) {
                rc = obd_get_info(env, mdt->mdt_child_exp,