Client should flush current sequence to make client obtain new one from server in case of disconnect/reconnect.
i=robert.read
i=johann
* Finish the current sequence due to disconnect.
* See mdc_import_event()
*/
-static void seq_client_flush(struct lu_client_seq *seq)
+void seq_client_flush(struct lu_client_seq *seq)
{
LASSERT(seq != NULL);
down(&seq->lcs_sem);
fid_init(&seq->lcs_fid);
+ /**
+ * this id shld not be used for seq range allocation.
+ * set to -1 for dgb check.
+ */
+ seq->lcs_space.lsr_mdt = -1;
range_init(&seq->lcs_space);
up(&seq->lcs_sem);
}
int mdc_fid_alloc(struct lu_client_seq *seq, struct lu_fid *fid);
+void seq_client_flush(struct lu_client_seq *seq);
+
struct mdc_open_data {
struct obd_client_handle *mod_och;
struct ptlrpc_request *mod_open_req;
break;
}
case IMP_EVENT_INACTIVE: {
+ struct client_obd *cli = &obd->u.cli;
+ /* Flush current sequence to make client obtain new one
+ * from server in case of disconnect/reconnect.
+ * If range is already empty then no need to flush it. */
+ if (cli->cl_seq != NULL &&
+ !range_is_exhausted(&cli->cl_seq->lcs_space))
+ seq_client_flush(cli->cl_seq);
+
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_INACTIVE, NULL);
break;
}