#define MDS_CLIENT_SLOTS 17
-#define MDS_MOUNT_RECOV 2
-
#define MDS_ROCOMPAT_LOVOBJID 0x00000001
#define MDS_ROCOMPAT_SUPP (MDS_ROCOMPAT_LOVOBJID)
/* 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 */
}
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);
}
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)
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));
/* 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);
}
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));
}
}
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);
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;
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));
/* 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);
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;
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",
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);
#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)
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
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"
cmppid=$!
fail ost
wait $cmppid || return 1
- rm $verify
+ rm -f $verify $DIR/$tfile
}
run_test 4 "Fail OST during read, with verification"