Whamcloud - gitweb
LU-7384 lfsck: check transaction stop status 42/17042/3
authorFan Yong <fan.yong@intel.com>
Fri, 18 Sep 2015 07:52:31 +0000 (15:52 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 24 Nov 2015 14:25:25 +0000 (14:25 +0000)
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 <fan.yong@intel.com>
Change-Id: If897b7bd479ecdb61e6435f3177211f865a4e303
Reviewed-on: http://review.whamcloud.com/17042
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lfsck/lfsck_namespace.c
lustre/osp/osp_md_object.c

index 58276a2..fa3b851 100644 (file)
@@ -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);
index 67d1516..69c815c 100644 (file)
@@ -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;
        }