Whamcloud - gitweb
b=20354
authorzhanghc <zhanghc>
Mon, 21 Sep 2009 06:17:55 +0000 (06:17 +0000)
committerzhanghc <zhanghc>
Mon, 21 Sep 2009 06:17:55 +0000 (06:17 +0000)
the client_uuid(lcd_uuid) stored in last_rcvd on server (MDT or OST)
could be corrupted, so it is needed to check during loading from disk

i=johann@sun.com
i=adilger@sun.com
i=tappro@sun.com

lustre/include/lustre_disk.h
lustre/mds/mds_fs.c
lustre/obdfilter/filter.c

index 73ace63..6070144 100644 (file)
@@ -262,6 +262,20 @@ struct lsd_client_data {
         __u8  lcd_padding[LR_CLIENT_SIZE - 128];
 };
 
+/* bug20354: the lcd_uuid for export of clients may be wrong */
+static inline void check_lcd(char *obd_name, int index,
+                             struct lsd_client_data *lcd)
+{
+        int length = sizeof(lcd->lcd_uuid);
+        if (strnlen(lcd->lcd_uuid, length) == length) {
+                lcd->lcd_uuid[length - 1] = '\0';
+
+                LCONSOLE_ERROR("the client UUID (%s) on %s for exports"
+                               "stored in last_rcvd(index = %d) is bad!\n", 
+                               lcd->lcd_uuid, obd_name, index);
+        }
+}
+
 static inline __u64 lsd_last_transno(struct lsd_client_data *lcd)
 {
         return le64_to_cpu(lcd->lcd_last_transno) >
index 22a7d55..efc9f1b 100644 (file)
@@ -612,6 +612,8 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file)
                         continue;
                 }
 
+                check_lcd(obd->obd_name, cl_idx, lcd);
+
                 last_transno = lsd_last_transno(lcd);
                 last_epoch = le32_to_cpu(lcd->lcd_last_epoch);
 
index a12b7bf..1f1c63c 100644 (file)
@@ -928,6 +928,8 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp)
                         continue;
                 }
 
+                check_lcd(obd->obd_name, cl_idx, lcd);
+
                 last_rcvd = le64_to_cpu(lcd->lcd_last_transno);
 
                 /* These exports are cleaned up by filter_disconnect(), so they