Whamcloud - gitweb
LU-5107 osp: only check FID for OSP connecting to OST 76/10476/4
authorwang di <di.wang@intel.com>
Wed, 28 May 2014 12:14:54 +0000 (05:14 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 30 May 2014 18:10:41 +0000 (18:10 +0000)
The backport of http://review.whamcloud.com/8997 to b2_5
(commit ed82a26746d22) didn't need MDT OSPs to allocate FIDs.
The call to osp_prepare_fid_client(d) should be moved after
the check if the OSP connecting to OST, because only such OSP
will intialize its FID client.

Test-Parameters: mdtcount=2 mdscount=2 testlist=sanity
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I0306a086d9274d520aa43b82ccdb39966ef2ae97
Reviewed-on: http://review.whamcloud.com/10476
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_dev.c

index a4a2f90..1c7438b 100644 (file)
@@ -859,16 +859,15 @@ static int osp_reconnect(const struct lu_env *env,
        return 0;
 }
 
-static int osp_prepare_fid_client(struct osp_device *osp)
+static void osp_prepare_fid_client(struct osp_device *osp)
 {
        LASSERT(osp->opd_obd->u.cli.cl_seq != NULL);
        if (osp->opd_obd->u.cli.cl_seq->lcs_exp != NULL)
-               return 0;
+               return;
 
        LASSERT(osp->opd_exp != NULL);
        osp->opd_obd->u.cli.cl_seq->lcs_exp =
                                class_export_get(osp->opd_exp);
-       return 0;
 }
 
 /*
@@ -1053,15 +1052,15 @@ static int osp_import_event(struct obd_device *obd, struct obd_import *imp,
        case IMP_EVENT_ACTIVE:
                d->opd_imp_active = 1;
 
-               if (osp_prepare_fid_client(d) != 0)
-                       break;
-
                if (d->opd_got_disconnected)
                        d->opd_new_connection = 1;
                d->opd_imp_connected = 1;
                d->opd_imp_seen_connected = 1;
                if (d->opd_connect_mdt)
                        break;
+
+               osp_prepare_fid_client(d);
+
                wake_up(&d->opd_pre_waitq);
                __osp_sync_check_for_work(d);
                CDEBUG(D_HA, "got connected\n");