Whamcloud - gitweb
LU-8972 osp: skip subsequent orphan cleanups 79/25079/3
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Wed, 25 Jan 2017 04:51:40 +0000 (07:51 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 31 Jan 2017 04:07:28 +0000 (04:07 +0000)
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 <alexey.zhuravlev@intel.com>
Reviewed-on: https://review.whamcloud.com/25079
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_precreate.c
lustre/tests/conf-sanity.sh

index f598387..ae7e4ef 100644 (file)
@@ -836,17 +836,19 @@ static int osp_precreate_cleanup_orphans(struct lu_env *env,
        if (body == NULL)
                GOTO(out, rc = -EPROTO);
 
        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);
        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;
                fid = d->opd_pre_last_created_fid;
-       else
+       } else {
                fid = d->opd_last_used_fid;
                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);
 
        spin_unlock(&d->opd_pre_lock);
        fid_to_ostid(&fid, &body->oa.o_oi);
 
index f8ad8ad..afad80b 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 ONLY=${ONLY:-"$*"}
 
 # bug number for skipped test:  LU-8972
 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
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 is_sles11()                                            # LU-2181