From 9a466ecccf5546e9fc3d0ce7b5c11280377e5a02 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Fri, 18 Sep 2015 15:52:31 +0800 Subject: [PATCH] LU-7384 lfsck: check transaction stop status The LFSCK modification will be sent to remote server when the transaction stop, for sync transaction case, we can check the dt_trans_stop() result. If the lfsck_namespace_create_orphan_dir() failed, but we may ignored that before because of ignoring dt_trans_stop result. Then it may cause subsequent lfsck_namespace_insert_normal() failed at LASSERT(lu_object_exists(o) != 0); Signed-off-by: Fan Yong Change-Id: If897b7bd479ecdb61e6435f3177211f865a4e303 Reviewed-on: http://review.whamcloud.com/17042 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: wangdi Reviewed-by: Oleg Drokin --- lustre/lfsck/lfsck_namespace.c | 5 ++++- lustre/osp/osp_md_object.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c index 58276a2..fa3b851 100644 --- a/lustre/lfsck/lfsck_namespace.c +++ b/lustre/lfsck/lfsck_namespace.c @@ -1288,6 +1288,7 @@ static int lfsck_namespace_create_orphan_dir(const struct lu_env *env, int namelen; int idx = 0; int rc = 0; + int rc1 = 0; ENTRY; LASSERT(!dt_object_exists(orphan)); @@ -1493,7 +1494,9 @@ unlock2: dt_write_unlock(env, orphan); stop: - dt_trans_stop(env, dev, th); + rc1 = dt_trans_stop(env, dev, th); + if (rc1 != 0 && rc > 0) + rc = rc1; unlock1: lfsck_unlock(llh); diff --git a/lustre/osp/osp_md_object.c b/lustre/osp/osp_md_object.c index 67d1516..69c815c 100644 --- a/lustre/osp/osp_md_object.c +++ b/lustre/osp/osp_md_object.c @@ -82,7 +82,7 @@ static int osp_object_create_interpreter(const struct lu_env *env, struct osp_object *obj, void *data, int index, int rc) { - if (rc != 0) { + if (rc != 0 && rc != -EEXIST) { obj->opo_obj.do_lu.lo_header->loh_attr &= ~LOHA_EXISTS; obj->opo_non_exist = 1; } -- 1.8.3.1