From 591dd865d4de19af65036eb3259c751cd23906c9 Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 23 Jun 2009 17:36:09 +0000 Subject: [PATCH 1/1] Branch HEAD 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 | 6 +++--- lustre/mdt/mdt_recovery.c | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre_disk.h b/lustre/include/lustre_disk.h index 9a81b46..841eeeb 100644 --- a/lustre/include/lustre_disk.h +++ b/lustre/include/lustre_disk.h @@ -236,10 +236,10 @@ struct lustre_mount_data { #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 +/** 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. diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 0fa48af..810d252 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -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); } + + /** 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; @@ -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; - 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; -- 1.8.3.1