From: tianying Date: Tue, 30 Dec 2003 02:37:44 +0000 (+0000) Subject: remove mount age check X-Git-Tag: 1.0.2~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e8b5f5b090d05df5b0c5bf5b628594c71d309c59;p=fs%2Flustre-release.git remove mount age check b: 2332 r: Shaver --- diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index fa3bafc..704436b 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -120,8 +120,6 @@ struct mds_update_record { #define MDS_CLIENT_SLOTS 17 -#define MDS_MOUNT_RECOV 2 - #define MDS_ROCOMPAT_LOVOBJID 0x00000001 #define MDS_ROCOMPAT_SUPP (MDS_ROCOMPAT_LOVOBJID) @@ -150,12 +148,11 @@ struct mds_server_data { /* Data stored per client in the last_rcvd file. In le32 order. */ struct mds_client_data { __u8 mcd_uuid[40]; /* client UUID */ - __u64 mcd_mount_count; /* MDS incarnation number */ __u64 mcd_last_transno; /* last completed transaction ID */ __u64 mcd_last_xid; /* xid for the last transaction */ __u32 mcd_last_result; /* result from last RPC */ __u32 mcd_last_data; /* per-op data (disposition for open &c.) */ - __u8 mcd_padding[MDS_LR_CLIENT_SIZE - 72]; + __u8 mcd_padding[MDS_LR_CLIENT_SIZE - 64]; }; /* file data for open files on MDS */ diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 9245d91..4961e32 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -949,7 +949,7 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc) } target_cancel_recovery_timer(obd); } else { - CERROR("%s: %d recoverable clients remain\n", + CWARN("%s: %d recoverable clients remain\n", obd->obd_name, obd->obd_recoverable_clients); wake_up(&obd->obd_next_transno_waitq); } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index a7c4984..8434ce0 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -281,7 +281,6 @@ static int mds_connect(struct lustre_handle *conn, struct obd_device *obd, memcpy(mcd->mcd_uuid, cluuid, sizeof(mcd->mcd_uuid)); med->med_mcd = mcd; - mcd->mcd_mount_count = cpu_to_le64(obd->u.mds.mds_mount_count); rc = mds_client_add(obd, &obd->u.mds, med, -1); if (rc == 0) diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 4a745c1..1dfc246 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -273,7 +273,8 @@ static int mds_read_last_rcvd(struct obd_device *obd, struct file *file) for (cl_idx = 0, off = le32_to_cpu(msd->msd_client_start); off < last_rcvd_size; cl_idx++) { __u64 last_transno; - int mount_age; + struct obd_export *exp; + struct mds_export_data *med; if (!mcd) { OBD_ALLOC_WAIT(mcd, sizeof(*mcd)); @@ -304,36 +305,27 @@ static int mds_read_last_rcvd(struct obd_device *obd, struct file *file) /* These exports are cleaned up by mds_disconnect(), so they * need to be set up like real exports as mds_connect() does. */ - mount_age = mount_count - le64_to_cpu(mcd->mcd_mount_count); - if (mount_age < MDS_MOUNT_RECOV) { - struct obd_export *exp = class_new_export(obd); - struct mds_export_data *med; - CDEBUG(D_HA, "RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64 - " srv lr: "LPU64" mnt: "LPU64" last mount: " - LPU64"\n", mcd->mcd_uuid, cl_idx, - last_transno, le64_to_cpu(msd->msd_last_transno), - le64_to_cpu(mcd->mcd_mount_count), mount_count); - if (exp == NULL) - GOTO(err_client, rc = -ENOMEM); - - memcpy(&exp->exp_client_uuid.uuid, mcd->mcd_uuid, - sizeof exp->exp_client_uuid.uuid); - med = &exp->exp_mds_data; - med->med_mcd = mcd; - mds_client_add(obd, mds, med, cl_idx); - /* create helper if export init gets more complex */ - INIT_LIST_HEAD(&med->med_open_head); - spin_lock_init(&med->med_open_lock); - - mcd = NULL; - obd->obd_recoverable_clients++; - obd->obd_max_recoverable_clients++; - class_export_put(exp); - } else { - CDEBUG(D_INFO, "discarded client %d, UUID '%s', count " - LPU64"\n", cl_idx, mcd->mcd_uuid, - le64_to_cpu(mcd->mcd_mount_count)); - } + CDEBUG(D_HA, "RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64 + " srv lr: "LPU64"\n", mcd->mcd_uuid, cl_idx, + last_transno, le64_to_cpu(msd->msd_last_transno)); + + exp = class_new_export(obd); + if (exp == NULL) + GOTO(err_client, rc = -ENOMEM); + + memcpy(&exp->exp_client_uuid.uuid, mcd->mcd_uuid, + sizeof exp->exp_client_uuid.uuid); + med = &exp->exp_mds_data; + med->med_mcd = mcd; + mds_client_add(obd, mds, med, cl_idx); + /* create helper if export init gets more complex */ + INIT_LIST_HEAD(&med->med_open_head); + spin_lock_init(&med->med_open_lock); + + mcd = NULL; + obd->obd_recoverable_clients++; + obd->obd_max_recoverable_clients++; + class_export_put(exp); CDEBUG(D_OTHER, "client at idx %d has last_transno = "LPU64"\n", cl_idx, last_transno); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 81fa3e5..5476684 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -519,7 +519,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched, } uuid = &watched->u.cli.cl_import->imp_target_uuid; - CERROR("MDS %s: %s now active, resetting orphans\n", + CWARN("MDS %s: %s now active, resetting orphans\n", obd->obd_name, uuid->uuid); RETURN(mds_lov_clearorphans(&obd->u.mds, uuid)); } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index bcddfd9..22ca65b 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -145,7 +145,6 @@ int mds_finish_transno(struct mds_obd *mds, struct inode *inode, void *handle, } req->rq_repmsg->transno = req->rq_transno = transno; mcd->mcd_last_transno = cpu_to_le64(transno); - mcd->mcd_mount_count = cpu_to_le64(mds->mds_mount_count); mcd->mcd_last_xid = cpu_to_le64(req->rq_xid); mcd->mcd_last_result = cpu_to_le32(rc); mcd->mcd_last_data = cpu_to_le32(op_data); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index dae4413..86eda2d 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -102,7 +102,6 @@ int filter_finish_transno(struct obd_export *exp, struct obd_trans_info *oti, spin_unlock(&filter->fo_translock); } fcd->fcd_last_rcvd = cpu_to_le64(last_rcvd); - fcd->fcd_mount_count = cpu_to_le64(filter->fo_mount_count); /* could get xid from oti, if it's ever needed */ fcd->fcd_last_xid = 0; @@ -428,7 +427,8 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) for (cl_idx = 0, off = le32_to_cpu(fsd->fsd_client_start); off < last_rcvd_size; cl_idx++) { __u64 last_rcvd; - int mount_age; + struct obd_export *exp; + struct filter_export_data *fed; if (!fcd) { OBD_ALLOC(fcd, sizeof(*fcd)); @@ -459,34 +459,24 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) /* These exports are cleaned up by filter_disconnect(), so they * need to be set up like real exports as filter_connect() does. */ - mount_age = mount_count - le64_to_cpu(fcd->fcd_mount_count); - if (mount_age < FILTER_MOUNT_RECOV) { - struct obd_export *exp = class_new_export(obd); - struct filter_export_data *fed; - CERROR("RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64 - " srv lr: "LPU64" mnt: "LPU64" last mount: " - LPU64"\n", fcd->fcd_uuid, cl_idx, - last_rcvd, le64_to_cpu(fsd->fsd_last_transno), - le64_to_cpu(fcd->fcd_mount_count), mount_count); - if (exp == NULL) - GOTO(err_client, rc = -ENOMEM); - - memcpy(&exp->exp_client_uuid.uuid, fcd->fcd_uuid, - sizeof exp->exp_client_uuid.uuid); - fed = &exp->exp_filter_data; - fed->fed_fcd = fcd; - filter_client_add(obd, filter, fed, cl_idx); - /* create helper if export init gets more complex */ - spin_lock_init(&fed->fed_lock); - - fcd = NULL; - obd->obd_recoverable_clients++; - class_export_put(exp); - } else { - CDEBUG(D_INFO, "discarded client %d UUID '%s' count " - LPU64"\n", cl_idx, fcd->fcd_uuid, - le64_to_cpu(fcd->fcd_mount_count)); - } + exp = class_new_export(obd); + CDEBUG(D_HA, "RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64 + " srv lr: "LPU64"\n", fcd->fcd_uuid, cl_idx, + last_rcvd, le64_to_cpu(fsd->fsd_last_transno)); + if (exp == NULL) + GOTO(err_client, rc = -ENOMEM); + + memcpy(&exp->exp_client_uuid.uuid, fcd->fcd_uuid, + sizeof exp->exp_client_uuid.uuid); + fed = &exp->exp_filter_data; + fed->fed_fcd = fcd; + filter_client_add(obd, filter, fed, cl_idx); + /* create helper if export init gets more complex */ + spin_lock_init(&fed->fed_lock); + + fcd = NULL; + obd->obd_recoverable_clients++; + class_export_put(exp); CDEBUG(D_OTHER, "client at idx %d has last_rcvd = "LPU64"\n", cl_idx, last_rcvd); @@ -499,7 +489,7 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) obd->obd_last_committed = le64_to_cpu(fsd->fsd_last_transno); if (obd->obd_recoverable_clients) { - CERROR("RECOVERY: %d recoverable clients, last_rcvd " + CWARN("RECOVERY: %d recoverable clients, last_rcvd " LPU64"\n", obd->obd_recoverable_clients, le64_to_cpu(fsd->fsd_last_transno)); obd->obd_next_recovery_transno = obd->obd_last_committed + 1; @@ -1097,7 +1087,7 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, if (*lcfg->lcfg_inlbuf3 == 'f') { obd->obd_replayable = 1; obd_sync_filter = 1; - CERROR("%s: recovery enabled\n", obd->obd_name); + CWARN("%s: recovery enabled\n", obd->obd_name); } else { if (*lcfg->lcfg_inlbuf3 != 'n') { CERROR("unrecognised flag '%c'\n", @@ -1307,7 +1297,6 @@ static int filter_connect(struct lustre_handle *conn, struct obd_device *obd, memcpy(fcd->fcd_uuid, cluuid, sizeof(fcd->fcd_uuid)); fed->fed_fcd = fcd; - fcd->fcd_mount_count = cpu_to_le64(filter->fo_mount_count); rc = filter_client_add(obd, filter, fed, -1); diff --git a/lustre/obdfilter/filter_internal.h b/lustre/obdfilter/filter_internal.h index a8e8a0f..610d969 100644 --- a/lustre/obdfilter/filter_internal.h +++ b/lustre/obdfilter/filter_internal.h @@ -41,7 +41,6 @@ #define FILTER_SUBDIR_COUNT 32 /* set to zero for no subdirs */ #define FILTER_GROUPS 3 /* must be at least 3; not dynamic yet */ -#define FILTER_MOUNT_RECOV 2 #define FILTER_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */ #define FILTER_ROCOMPAT_SUPP (0) @@ -73,9 +72,8 @@ struct filter_server_data { struct filter_client_data { __u8 fcd_uuid[40]; /* client UUID */ __u64 fcd_last_rcvd; /* last completed transaction ID */ - __u64 fcd_mount_count; /* FILTER incarnation number */ __u64 fcd_last_xid; /* client RPC xid for the last transaction */ - __u8 fcd_padding[FILTER_LR_CLIENT_SIZE - 64]; + __u8 fcd_padding[FILTER_LR_CLIENT_SIZE - 56]; }; #define FILTER_DENTRY_MAGIC 0x9efba101 diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index 2fd4f42..56e6faa 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -101,7 +101,7 @@ test_3() { fail ost wait $ddpid || return 1 cmp $verify $DIR/$tfile || return 2 - rm $verify + rm -f $verify $DIR/$tfile } run_test 3 "Fail OST during write, with verification" @@ -116,7 +116,7 @@ test_4() { cmppid=$! fail ost wait $cmppid || return 1 - rm $verify + rm -f $verify $DIR/$tfile } run_test 4 "Fail OST during read, with verification"