From 5215f11da7747d52f47ad3fd6ae3322b71990b68 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Mon, 31 Aug 2020 11:49:59 +0300 Subject: [PATCH] LU-13935 ofd: object removal is not handled properly We should not check for object existence in ofd_version_get_check() when we haven't got the lock yet. ofd_attr_set() will check it later. In ofd_destroy(), we should unlock if the object does not exist, otherwise oti_w_locks assertion will fail. Change-Id: I00f67d15c3268bcf55aafa88c088f2dbf55a470c Signed-off-by: Andrew Perepechko HPE-bug-id: LUS-9063,LUS-9282 Reviewed-on: https://review.whamcloud.com/39765 Reviewed-by: Alexander Zarochentsev Reviewed-by: Alexander Boyko Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/ofd/ofd_objects.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index 4982a49..f99d86b 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -64,8 +64,6 @@ static int ofd_version_get_check(struct ofd_thread_info *info, { dt_obj_version_t curr_version; - LASSERT(ofd_object_exists(fo)); - if (info->fti_exp == NULL) RETURN(0); @@ -1021,14 +1019,14 @@ int ofd_destroy(const struct lu_env *env, struct ofd_object *fo, ofd_write_lock(env, fo); if (!ofd_object_exists(fo)) - GOTO(stop, rc = -ENOENT); + GOTO(unlock, rc = -ENOENT); tgt_fmd_drop(ofd_info(env)->fti_exp, &fo->ofo_header.loh_fid); dt_ref_del(env, ofd_object_child(fo), th); dt_destroy(env, ofd_object_child(fo), th); +unlock: ofd_write_unlock(env, fo); - stop: rc2 = ofd_trans_stop(env, ofd, th, rc); if (rc2) -- 1.8.3.1