Whamcloud - gitweb
Branch: b1_6
authorwangdi <wangdi>
Thu, 31 May 2007 00:42:39 +0000 (00:42 +0000)
committerwangdi <wangdi>
Thu, 31 May 2007 00:42:39 +0000 (00:42 +0000)
Branch:b1_4
set cat log bitmap only after create log success
b=12556
i=green
i=nathan

lustre/ChangeLog
lustre/include/obd_support.h
lustre/obdclass/llog_cat.c

index f9df72c..2d53e4f 100644 (file)
@@ -247,6 +247,13 @@ Details    : in some rare cases, the open intent error is not checked before
             ASSERTION(open_req->rq_transno != 0), because it tries to release
             the failed open handle.
 
+Severity   : normal
+Frequency  : rare
+Bugzilla   : 12556 
+Description: Set cat log bitmap only after create log success. 
+Details    : in some rare cases, the cat log bitmap is set too early. and it 
+            should be set only after create log success.
+
 --------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <info@clusterfs.com>
index c514d16..10678f8 100644 (file)
@@ -100,6 +100,7 @@ extern int obd_race_state;
 #define OBD_FAIL_MDS_SETXATTR_WRITE      0x134
 #define OBD_FAIL_MDS_FS_SETUP            0x135
 #define OBD_FAIL_MDS_RESEND              0x136
+#define OBD_FAIL_MDS_LLOG_CREATE_FAILED  0x137
 
 #define OBD_FAIL_OST                     0x200
 #define OBD_FAIL_OST_CONNECT_NET         0x201
index 9fe257a..e42fab8 100644 (file)
@@ -65,28 +65,30 @@ static struct llog_handle *llog_cat_new_log(struct llog_handle *cathandle)
         if (llh->llh_cat_idx == index) {
                 CERROR("no free catalog slots for log...\n");
                 RETURN(ERR_PTR(-ENOSPC));
-        } else {
-                if (index == 0)
-                        index = 1;
-                if (ext2_set_bit(index, llh->llh_bitmap)) {
-                        CERROR("argh, index %u already set in log bitmap?\n",
-                               index);
-                        LBUG(); /* should never happen */
-                }
-                cathandle->lgh_last_idx = index;
-                llh->llh_count++;
-                llh->llh_tail.lrt_index = index;
         }
 
+        if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_MDS_LLOG_CREATE_FAILED))
+                RETURN(ERR_PTR(-ENOSPC));
+        
         rc = llog_create(cathandle->lgh_ctxt, &loghandle, NULL, NULL);
         if (rc)
                 RETURN(ERR_PTR(rc));
-
+        
         rc = llog_init_handle(loghandle,
                               LLOG_F_IS_PLAIN | LLOG_F_ZAP_WHEN_EMPTY,
                               &cathandle->lgh_hdr->llh_tgtuuid);
         if (rc)
                 GOTO(out_destroy, rc);
+        if (index == 0)
+                index = 1;
+        if (ext2_set_bit(index, llh->llh_bitmap)) {
+                CERROR("argh, index %u already set in log bitmap?\n",
+                       index);
+                LBUG(); /* should never happen */
+        }
+        cathandle->lgh_last_idx = index;
+        llh->llh_count++;
+        llh->llh_tail.lrt_index = index;
 
         CDEBUG(D_HA, "new recovery log "LPX64":%x for index %u of catalog "
                LPX64"\n", loghandle->lgh_id.lgl_oid, loghandle->lgh_id.lgl_ogen,