Whamcloud - gitweb
b=21476 fix race between mdt_finish and __mds_lov_synchronize
authorpravin <Pravin.Shelar@sun.com>
Mon, 5 Apr 2010 18:49:56 +0000 (11:49 -0700)
committerRobert Read <robert.read@oracle.com>
Mon, 5 Apr 2010 18:49:56 +0000 (11:49 -0700)
i=FanYong
i=Rahul

lustre/include/obd_support.h
lustre/mdd/mdd_device.c
lustre/mds/mds_lov.c
lustre/tests/recovery-small.sh

index ae14668..87798f8 100644 (file)
@@ -403,7 +403,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,
 #define OBD_FAIL_LLOG_ORIGIN_HANDLE_WRITE_REC_NET   0x1307
 #define OBD_FAIL_LLOG_ORIGIN_HANDLE_CLOSE_NET       0x1308
 #define OBD_FAIL_LLOG_CATINFO_NET                   0x1309
 #define OBD_FAIL_LLOG_ORIGIN_HANDLE_WRITE_REC_NET   0x1307
 #define OBD_FAIL_LLOG_ORIGIN_HANDLE_CLOSE_NET       0x1308
 #define OBD_FAIL_LLOG_CATINFO_NET                   0x1309
-
+#define OBD_FAIL_MDS_SYNC_CAPA_SL                    0x1310
 
 /* Failure injection control */
 #define OBD_FAIL_MASK_SYS    0x0000FF00
 
 /* Failure injection control */
 #define OBD_FAIL_MASK_SYS    0x0000FF00
index 95408d8..9262fa9 100644 (file)
@@ -1165,7 +1165,11 @@ static int mdd_init_capa_ctxt(const struct lu_env *env, struct md_device *m,
         int rc;
         ENTRY;
 
         int rc;
         ENTRY;
 
+        /* need barrier for mds_capa_keys access. */
+        cfs_down_write(&mds->mds_notify_lock);
         mds->mds_capa_keys = keys;
         mds->mds_capa_keys = keys;
+        cfs_up_write(&mds->mds_notify_lock);
+
         rc = mdd_child_ops(mdd)->dt_init_capa_ctxt(env, mdd->mdd_child, mode,
                                                    timeout, alg, keys);
         RETURN(rc);
         rc = mdd_child_ops(mdd)->dt_init_capa_ctxt(env, mdd->mdd_child, mode,
                                                    timeout, alg, keys);
         RETURN(rc);
index ac9fa01..0572938 100644 (file)
@@ -791,6 +791,7 @@ static int mds_propagate_capa_keys(struct mds_obd *mds, struct obd_uuid *uuid)
         if (!mds->mds_capa_keys)
                 RETURN(0);
 
         if (!mds->mds_capa_keys)
                 RETURN(0);
 
+        OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_SYNC_CAPA_SL, 5);
         for (i = 0; i < 2; i++) {
                 key = &mds->mds_capa_keys[i];
                 DEBUG_CAPA_KEY(D_SEC, key, "propagate");
         for (i = 0; i < 2; i++) {
                 key = &mds->mds_capa_keys[i];
                 DEBUG_CAPA_KEY(D_SEC, key, "propagate");
index 43507fd..e9fb4d9 100755 (executable)
@@ -805,6 +805,9 @@ test_50() {
 run_test 50 "failover MDS under load"
 
 test_51() {
 run_test 50 "failover MDS under load"
 
 test_51() {
+       #define OBD_FAIL_MDS_SYNC_CAPA_SL                    0x1310
+       do_facet ost1 lctl set_param fail_loc=0x00001310
+
        mkdir -p $DIR/$tdir
        # put a load of file creates/writes/deletes
        writemany -q $DIR/$tdir/$tfile 0 5 &
        mkdir -p $DIR/$tdir
        # put a load of file creates/writes/deletes
        writemany -q $DIR/$tdir/$tfile 0 5 &