From 6f56f71b407a8c14db4c2accd37da5b4feecde1a Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Wed, 25 Jan 2017 07:51:40 +0300 Subject: [PATCH] LU-8972 osp: skip subsequent orphan cleanups orphan cleanup should be done once, then we need to recreate missing precreated objects (due to OST failures). otherwise we risk to hit a deadlock (if we block creations during orphan cleanup) or destroy objects being allocated (which results in data corruptions). Change-Id: Ie8bc301ae4463c170b0cf5fc5ddd52e41fa88638 Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/25079 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/osp/osp_precreate.c | 8 +++++--- lustre/tests/conf-sanity.sh | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/osp/osp_precreate.c b/lustre/osp/osp_precreate.c index f598387..ae7e4ef 100644 --- a/lustre/osp/osp_precreate.c +++ b/lustre/osp/osp_precreate.c @@ -836,17 +836,19 @@ static int osp_precreate_cleanup_orphans(struct lu_env *env, if (body == NULL) GOTO(out, rc = -EPROTO); - body->oa.o_flags = OBD_FL_DELORPHAN; + body->oa.o_flags = 0; body->oa.o_valid = OBD_MD_FLFLAGS | OBD_MD_FLGROUP; /* unless this is the very first DELORPHAN (when we really * can destroy some orphans), just tell OST to recreate * missing objects in our precreate pool */ spin_lock(&d->opd_pre_lock); - if (d->opd_pre->osp_pre_delorphan_sent) + if (d->opd_pre->osp_pre_delorphan_sent) { fid = d->opd_pre_last_created_fid; - else + } else { fid = d->opd_last_used_fid; + body->oa.o_flags = OBD_FL_DELORPHAN; + } spin_unlock(&d->opd_pre_lock); fid_to_ostid(&fid, &body->oa.o_oi); diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index f8ad8ad..afad80b 100755 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -5,7 +5,7 @@ set -e ONLY=${ONLY:-"$*"} # bug number for skipped test: LU-8972 -ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 101" +ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT" # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! is_sles11() # LU-2181 -- 1.8.3.1