From 9b643f4f54c3e9e0c07c2211904a72ad9c4f823f Mon Sep 17 00:00:00 2001 From: wang di Date: Fri, 24 Jan 2014 14:21:07 -0800 Subject: [PATCH] LU-4413 osp: move seq allocation out of osp_import_event Because seq allocation(osp_init_pre_fid) might be stuck during RPC, move it out of osp_import_event, which is inside ptlrpcd_rcv. Otherwise, some other import RPCs(like connect req)might be blocked in ptlrpcd_rcv. Signed-off-by: wang di Change-Id: Ib4014f8b0088ea3613fa4d53d3e274f5bdfe70c7 Reviewed-on: http://review.whamcloud.com/8997 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/osp/osp_dev.c | 15 --------------- lustre/osp/osp_precreate.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index d246678..819338b 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -863,8 +863,6 @@ static int osp_reconnect(const struct lu_env *env, static int osp_prepare_fid_client(struct osp_device *osp) { - int rc; - LASSERT(osp->opd_obd->u.cli.cl_seq != NULL); if (osp->opd_obd->u.cli.cl_seq->lcs_exp != NULL) return 0; @@ -872,19 +870,6 @@ static int osp_prepare_fid_client(struct osp_device *osp) LASSERT(osp->opd_exp != NULL); osp->opd_obd->u.cli.cl_seq->lcs_exp = class_export_get(osp->opd_exp); - if (osp->opd_pre == NULL) - return 0; - - /* Init fid for osp_precreate if necessary */ - rc = osp_init_pre_fid(osp); - if (rc != 0) { - class_export_put(osp->opd_exp); - osp->opd_obd->u.cli.cl_seq->lcs_exp = NULL; - CERROR("%s: init pre fid error: rc = %d\n", - osp->opd_obd->obd_name, rc); - return rc; - } - return 0; } diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index 6b1db95..22a1060 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -916,6 +916,16 @@ static int osp_precreate_thread(void *_arg) if (d->opd_obd->u.cli.cl_seq->lcs_exp == NULL) continue; + /* Init fid for osp_precreate if necessary */ + rc = osp_init_pre_fid(d); + if (rc != 0) { + class_export_put(d->opd_exp); + d->opd_obd->u.cli.cl_seq->lcs_exp = NULL; + CERROR("%s: init pre fid error: rc = %d\n", + d->opd_obd->obd_name, rc); + continue; + } + osp_statfs_update(d); /* -- 1.8.3.1