- small ext3 extents cleanups and fixes (5733)
- improved mballoc code, several small races and bugs fixed (5733, 5638)
- kernel version 43: fix remove_suid bugs in both 2.4 and 2.6 (5695)
+ - avoid needless client->OST connect, fix handle mismatch (5317)
* miscellania
- service request history (4965)
- put {ll,lov,osc}_async_page structs in a single slab (4699)
void *cb_data);
/* mdc/mdc_request.c */
-int mdc_init_ea_size(struct obd_device *obd, char *lov_name);
+int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp);
int mdc_req2lustre_md(struct ptlrpc_request *req, int offset,
- struct obd_export *exp,
- struct lustre_md *md);
+ struct obd_export *exp, struct lustre_md *md);
int mdc_getstatus(struct obd_export *exp, struct ll_fid *rootfid);
int mdc_getattr(struct obd_export *exp, struct ll_fid *fid,
unsigned long valid, unsigned int ea_size,
class_import_put(imp);
cli->cl_import = imp;
+ /* cli->cl_max_mds_{easize,cookiesize} updated by mdc_init_ea_size() */
cli->cl_max_mds_easize = sizeof(struct lov_mds_md);
cli->cl_max_mds_cookiesize = sizeof(struct llog_cookie);
cli->cl_sandev = to_kdev_t(0);
GOTO(out_free, err = -EINVAL);
}
- if (mdc_init_ea_size(obd, osc))
- GOTO(out_free, err = -EINVAL);
-
/* setup mdc */
err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid);
if (err) {
}
sbi->ll_osc_exp = class_conn2export(&osc_conn);
+ mdc_init_ea_size(sbi->ll_mdc_exp, sbi->ll_osc_exp);
+
err = mdc_getstatus(sbi->ll_mdc_exp, &rootfid);
if (err) {
CERROR("cannot mds_connect: rc = %d\n", err);
ENTRY;
LASSERT(de != NULL);
lld = ll_d2d(de);
- if (lld == NULL) {
+ if (lld == NULL) { /* NFS copies the de->d_op methods (bug 4655) */
EXIT;
return;
}
CERROR("could not register mount in /proc/lustre");
}
- mdc_init_ea_size(obd, osc);
-
err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid);
if (err == -EBUSY) {
CERROR("An MDS (mdc %s) is performing recovery, of which this"
}
sbi->ll_osc_exp = class_conn2export(&osc_conn);
+ mdc_init_ea_size(sbi->ll_mdc_exp, sbi->ll_osc_exp);
+
if (!ll_async_page_slab) {
ll_async_page_slab_size =
size_round(sizeof(struct ll_async_page)) +
case OBD_IOC_LLOG_PRINT: {
ctxt = llog_get_context(obd, LLOG_CONFIG_REPL_CTXT);
rc = llog_ioctl(ctxt, cmd, data);
-
+
GOTO(out, rc);
}
#endif
RETURN(rc);
}
-int mdc_init_ea_size(struct obd_device *obd, char *lov_name)
+/* Initialize the maximum LOV EA and cookie sizes. This allows
+ * us to make MDS RPCs with large enough reply buffers to hold the
+ * maximum-sized (= maximum striped) EA and cookie without having to
+ * calculate this (via a call into the LOV + OSCs) each time we make an RPC. */
+int mdc_init_ea_size(struct obd_export *mdc_exp, struct obd_export *lov_exp)
{
+ struct obd_device *obd = mdc_exp->exp_obd;
struct client_obd *cli = &obd->u.cli;
- struct obd_device *lov_obd;
- struct obd_export *exp;
- struct lustre_handle conn;
+ struct lov_stripe_md lsm = { .lsm_magic = LOV_MAGIC };
struct lov_desc desc;
- int valsize;
- int rc;
-
- lov_obd = class_name2obd(lov_name);
- if (!lov_obd) {
- CERROR("MDC cannot locate LOV %s!\n", lov_name);
- RETURN(-ENOTCONN);
- }
+ __u32 valsize = sizeof(desc);
+ int rc, size;
+ ENTRY;
- rc = obd_connect(&conn, lov_obd, &obd->obd_uuid);
- if (rc) {
- CERROR("MDC failed connect to LOV %s (%d)\n", lov_name, rc);
+ rc = obd_get_info(lov_exp, strlen("lovdesc") + 1, "lovdesc",
+ &valsize, &desc);
+ if (rc < 0)
RETURN(rc);
- }
- exp = class_conn2export(&conn);
- valsize = sizeof(desc);
- rc = obd_get_info(exp, strlen("lovdesc") + 1, "lovdesc",
- &valsize, &desc);
- if (rc == 0) {
- cli->cl_max_mds_easize = obd_size_diskmd(exp, NULL);
- cli->cl_max_mds_cookiesize = desc.ld_tgt_count *
- sizeof(struct llog_cookie);
- }
- obd_disconnect(exp, 0);
- RETURN(rc);
+ lsm.lsm_stripe_count = desc.ld_tgt_count;
+ size = obd_size_diskmd(lov_exp, &lsm);
+ if (cli->cl_max_mds_easize < size)
+ cli->cl_max_mds_easize = size;
+
+ size = desc.ld_tgt_count * sizeof(struct llog_cookie);
+ if (cli->cl_max_mds_cookiesize < size)
+ cli->cl_max_mds_cookiesize = size;
+
+ RETURN(0);
}
static int mdc_precleanup(struct obd_device *obd, int flags)
start ost --reformat $OSTLCONFARGS
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
start mds --reformat $MDSLCONFARGS
- grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
+
+ if [ -z "`grep " $MOUNT " /proc/mounts`" ]; then
+ # test "-1" needed during initial client->OST connection
+ log "== test 00: target handle mismatch (bug 5317) === `date +%H:%M:%S`"
+
+ #define OBD_FAIL_OST_ALL_REPLY_NET 0x211
+ do_facet ost "sysctl -w lustre.fail_loc=0x80000211"
+
+ zconf_mount `hostname` $MOUNT && df $MOUNT && pass || error "mount fail"
+ fi
}
mkdir -p $DIR