- transfer only one audit record on one notify.
- make sure the connection has been established before using the mdc export on name reconstruction.
RETURN(rc);
}
+ if (keylen == strlen("chkconnect") &&
+ memcpy(key, "chkconnect", keylen) == 0) {
+ rc = lmv_check_connect(obd);
+ RETURN(rc);
+ }
+
RETURN(-EINVAL);
}
struct lmv_obd *lmv = &obd->u.mds.mds_md_obd->u.lmv;
struct parseid_pkg *body;
int size = sizeof(*body);
- struct obd_export *exp = lmv->tgts[mds_num].ltd_exp;
+ struct obd_export *exp;
+ /* make sure connection established */
+ rc = obd_set_info(obd->u.mds.mds_md_exp, strlen("chkconnect"),
+ "chkconnect", 0, NULL);
+ if (rc)
+ RETURN(rc);
+
+ exp = lmv->tgts[mds_num].ltd_exp;
+ LASSERT(exp);
+
req = ptlrpc_prep_req(class_exp2cliimp(exp),
LUSTRE_MDS_VERSION, MDS_PARSE_ID, 1,
&size, NULL);
struct lmv_obd *lmv = &obd->u.mds.mds_md_obd->u.lmv;
struct parseid_pkg *body;
int size = sizeof(*body);
- struct obd_export *exp = lmv->tgts[mds_num].ltd_exp;
+ struct obd_export *exp;
+ /* make sure connection established */
+ rc = obd_set_info(obd->u.mds.mds_md_exp, strlen("chkconnect"),
+ "chkconnect", 0, NULL);
+ if (rc)
+ RETURN(rc);
+
+ exp = lmv->tgts[mds_num].ltd_exp;
+ LASSERT(exp);
+
req = ptlrpc_prep_req(class_exp2cliimp(exp),
LUSTRE_MDS_VERSION, MDS_PARSE_ID, 1,
&size, NULL);
int cleanup_phase = 0;
int update_mode, rc = 0;
struct lustre_id ids[2]; /* sid, pid */
+ struct obd_export *set_exp;
ENTRY;
/*
GOTO(cleanup, rc);
ids[0] = *(rec->ur_id1);
- rc = obd_set_info(mds->mds_md_exp, strlen("ids"), "ids",
+ if (id_group(ids) == mds->mds_num)
+ set_exp = req->rq_export;
+ else
+ set_exp = mds->mds_md_exp;
+ rc = obd_set_info(set_exp, strlen("ids"), "ids",
sizeof(struct lustre_id) * 2, ids);
EXIT;
if (de_old->d_flags & DCACHE_CROSS_REF) {
struct lustre_id old_id;
+ struct obd_export *set_exp;
mds_pack_dentry2id(obd, &old_id, de_old, 1);
GOTO(cleanup, rc);
ids[0] = old_id;
- rc = obd_set_info(mds->mds_md_exp, strlen("ids"), "ids",
+ if (id_group(ids) == mds->mds_num)
+ set_exp = req->rq_export;
+ else
+ set_exp = mds->mds_md_exp;
+ rc = obd_set_info(set_exp, strlen("ids"), "ids",
sizeof(struct lustre_id) * 2, ids);
GOTO(cleanup, rc);
rec->nid = current->user->nid;
rec->time = cur_time.tv_sec * USEC_PER_SEC + cur_time.tv_usec;
-
len = handler[code](inode, msg, priv, (char*)rec,
&llh->lrh_type);
+ LASSERT(llh->lrh_type == SMFS_AUDIT_GEN_REC ||
+ llh->lrh_type == SMFS_AUDIT_NAME_REC);
+
llh->lrh_len = size_round(len);
rc = llog_cat_add_rec(priv->audit_ctxt->loc_handle, llh, NULL,
{
struct obd_device *obd = llh->lgh_ctxt->loc_obd;
struct audit_record *ad_rec;
-
+ struct llog_cookie cookie;
ENTRY;
if (!(le32_to_cpu(llh->lgh_hdr->llh_flags) & LLOG_F_IS_PLAIN)) {
LASSERT(ad_rec->opcode < AUDIT_MAX);
+ cookie.lgc_lgl = llh->lgh_id;
+ cookie.lgc_subsys = LLOG_AUDIT_ORIG_CTXT;
+ cookie.lgc_index = le32_to_cpu(rec->lrh_index);
+
transfer_record(obd, ad_rec, rec->lrh_type, data);
- RETURN(LLOG_DEL_RECORD);
+ llog_cancel(llh->lgh_ctxt, 1, &cookie, 0, NULL);
+
+ RETURN(LLOG_PROC_BREAK);
}
static int audit_transfer(struct transfer_item *ti)
ENTRY;
rc = llog_cat_process(llh, (llog_cb_t)&transfer_cb, ti->id2name);
- if (rc)
+ if (rc != LLOG_PROC_BREAK)
CERROR("process catalog log failed: rc(%d)\n", rc);
RETURN(0);