From dedd502b406c35506f619b89e0e8cb65362aaf57 Mon Sep 17 00:00:00 2001 From: zab Date: Tue, 7 Oct 2003 05:11:54 +0000 Subject: [PATCH] b=1948 r=phil Restore the echo_client to working order. We fix up the object creation paths and fix up some bad export refcounting behaviour. - get rid of an extra export put in the lov_disconnect path. This was covering up for an export leak in oscc_init. We put that export reference in osc_disconnect. - add a little helper to transfer the object group number from the obdo to the io obj. - have the echo_client use group 2 for its objects so it doesn't conflict with the group 0 objects used by the filesystem. - get the oid from obd_create from the lsm_obj_id returned instead of the overloaded o_id - get rid of some extra export_puts in the echo_client's brw testing paths - get rid of an extra export_put in echo_client_cleanup - alter quite a bit of the filter object paths to pass the proper group around - fix up some assumptions the filter has about group numbers that are no longer true after the addition of the echo_client's group 2. this is begging for some enums. - stop lbuging when io is attempted in the filter against an object that doesn't exist - only do pre-creation in the filter for group 0 - be sure to set the caller's lsm in all filter_create success paths - pass osc create requests right on to the ost if they aren't in group 0 - in your face, tab! --- lustre/obdclass/obdo.c | 11 +++++++++++ lustre/obdfilter/filter_internal.h | 4 ++-- lustre/obdfilter/filter_io.c | 7 +++---- lustre/obdfilter/filter_log.c | 3 ++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index 63e4a13..938c3f7 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -358,3 +358,14 @@ int obdo_cmp_md(struct obdo *dst, struct obdo *src, obd_flag compare) return res; } EXPORT_SYMBOL(obdo_cmp_md); + +void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj) +{ + ioobj->ioo_id = oa->o_id; + if (oa->o_valid & OBD_MD_FLGROUP) + ioobj->ioo_gr = oa->o_gr; + else + ioobj->ioo_gr = 0; + ioobj->ioo_type = oa->o_mode; +} +EXPORT_SYMBOL(obdo_to_ioobj); diff --git a/lustre/obdfilter/filter_internal.h b/lustre/obdfilter/filter_internal.h index b171342..b2995ea 100644 --- a/lustre/obdfilter/filter_internal.h +++ b/lustre/obdfilter/filter_internal.h @@ -39,7 +39,7 @@ #define FILTER_LR_MAX_CLIENT_WORDS (FILTER_LR_MAX_CLIENTS/sizeof(unsigned long)) #define FILTER_SUBDIR_COUNT 32 /* set to zero for no subdirs */ -#define FILTER_GROUPS 2 /* must be at least 3; not dynamic yet */ +#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* */ @@ -104,7 +104,7 @@ struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa, int filter_finish_transno(struct obd_export *, struct obd_trans_info *, int rc); __u64 filter_next_id(struct filter_obd *, struct obdo *); -int filter_update_server_data(struct obd_device *, struct file *, +int filter_update_server_data(struct obd_device *, struct file *, obd_gr, struct filter_server_data *, int force_sync); int filter_update_last_objid(struct obd_device *, obd_gr, int force_sync); int filter_common_setup(struct obd_device *, obd_count len, void *buf, diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 43f16f4..4ee3356 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -277,7 +277,8 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa, memset(res, 0, niocount * sizeof(*res)); push_ctxt(&saved, &exp->exp_obd->obd_ctxt, NULL); - dentry = filter_fid2dentry(exp->exp_obd, NULL, 0, obj->ioo_id); + dentry = filter_fid2dentry(exp->exp_obd, NULL, obj->ioo_gr, + obj->ioo_id); if (IS_ERR(dentry)) GOTO(cleanup, rc = PTR_ERR(dentry)); @@ -450,9 +451,7 @@ int filter_brw(int cmd, struct obd_export *exp, struct obdo *oa, rnb[i].len = pga[i].count; } - ioo.ioo_id = oa->o_id; - ioo.ioo_gr = 0; - ioo.ioo_type = oa->o_mode & S_IFMT; + obdo_to_ioobj(oa, &ioo); ioo.ioo_bufcnt = oa_bufs; ret = filter_preprw(cmd, exp, oa, 1, &ioo, oa_bufs, rnb, lnb, oti); diff --git a/lustre/obdfilter/filter_log.c b/lustre/obdfilter/filter_log.c index e5a5b61..144c693 100644 --- a/lustre/obdfilter/filter_log.c +++ b/lustre/obdfilter/filter_log.c @@ -72,7 +72,8 @@ struct llog_handle *filter_get_catalog(struct obd_device *obd) logid = cathandle->lgh_id; fsd->fsd_catalog_oid = cpu_to_le64(logid.lgl_oid); fsd->fsd_catalog_ogr = cpu_to_le64(logid.lgl_ogr); - rc = filter_update_server_data(obd, filter->fo_rcvd_filp,fsd,0); + rc = filter_update_server_data(obd, filter->fo_rcvd_filp, 1, + fsd, 0); if (rc) { CERROR("error writing new catalog to disk: rc %d\n",rc); GOTO(out_handle, rc); -- 1.8.3.1