Whamcloud - gitweb
Branch HEAD
authortappro <tappro>
Tue, 23 Jun 2009 17:36:09 +0000 (17:36 +0000)
committertappro <tappro>
Tue, 23 Jun 2009 17:36:09 +0000 (17:36 +0000)
b=19885
i=rread
i=zam

Simpified interop case. When 2.0 server is started over old 1.8 FS it evicts
clients by truncating last_rcvd file. Therefore clients will use 2.0-formatted RPC after
reconnect

lustre/include/lustre_disk.h
lustre/mdt/mdt_recovery.c

index 9a81b46..841eeeb 100644 (file)
@@ -236,10 +236,10 @@ struct lustre_mount_data {
 #define OBD_INCOMPAT_COMMON_LR  0x00000008
 /** FID is enabled */
 #define OBD_INCOMPAT_FID        0x00000010
 #define OBD_INCOMPAT_COMMON_LR  0x00000008
 /** FID is enabled */
 #define OBD_INCOMPAT_FID        0x00000010
-/**
- * lustre disk using iam format to store directory entries
- */
+/** lustre disk using iam format to store directory entries */
 #define OBD_INCOMPAT_IAM_DIR    0x00000020
 #define OBD_INCOMPAT_IAM_DIR    0x00000020
+/** 2.0 server, interop flag to show server is changed */
+#define OBD_INCOMPAT_20         0x00000040
 
 
 /* Data stored per server at the head of the last_rcvd file.  In le32 order.
 
 
 /* Data stored per server at the head of the last_rcvd file.  In le32 order.
index 0fa48af..810d252 100644 (file)
@@ -432,6 +432,17 @@ static int mdt_server_data_init(const struct lu_env *env,
                                            obd->obd_uuid.uuid, lsd->lsd_uuid);
                         GOTO(out, rc = -EINVAL);
                 }
                                            obd->obd_uuid.uuid, lsd->lsd_uuid);
                         GOTO(out, rc = -EINVAL);
                 }
+
+                /** evict all clients as it is first boot with old last_rcvd */
+                if (!(lsd->lsd_feature_incompat & OBD_INCOMPAT_20)) {
+                        LCONSOLE_WARN("Mounting %s at first time on old FS, "
+                                      "remove all clients for interop needs\n",
+                                      obd->obd_name);
+                        simple_truncate(lsi->lsi_srv_mnt->mnt_sb->s_root,
+                                        lsi->lsi_srv_mnt, LAST_RCVD,
+                                        lsd->lsd_client_start);
+                        last_rcvd_size = lsd->lsd_client_start;
+                }
         }
         mount_count = lsd->lsd_mount_count;
 
         }
         mount_count = lsd->lsd_mount_count;
 
@@ -440,8 +451,8 @@ static int mdt_server_data_init(const struct lu_env *env,
         if (ldd->ldd_flags & LDD_F_IAM_DIR)
                 lsd->lsd_feature_incompat |= OBD_INCOMPAT_IAM_DIR;
 
         if (ldd->ldd_flags & LDD_F_IAM_DIR)
                 lsd->lsd_feature_incompat |= OBD_INCOMPAT_IAM_DIR;
 
-        lsd->lsd_feature_compat = OBD_COMPAT_MDT;
-        lsd->lsd_feature_incompat |= OBD_INCOMPAT_FID;
+        lsd->lsd_feature_compat = 0;
+        lsd->lsd_feature_incompat |= OBD_INCOMPAT_FID | OBD_INCOMPAT_20;
 
         spin_lock(&mdt->mdt_transno_lock);
         mdt->mdt_last_transno = lsd->lsd_last_transno;
 
         spin_lock(&mdt->mdt_transno_lock);
         mdt->mdt_last_transno = lsd->lsd_last_transno;