Whamcloud - gitweb
LU-12675 mdt: release object reference upon error
[fs/lustre-release.git] / lustre / mdt / mdt_reint.c
index 97672f3..9970f98 100644 (file)
@@ -767,10 +767,10 @@ static int mdt_reint_setattr(struct mdt_thread_info *info,
                        buf->lb_buf = lmu;
                        buf->lb_len = ma->ma_lmv_size;
 
-                       if (le32_to_cpu(lmu->lum_hash_type) ==
-                           LMV_HASH_TYPE_SPACE) {
+                       if (le32_to_cpu(lmu->lum_hash_type) &
+                           LMV_HASH_FLAG_SPACE) {
                                /*
-                                * only allow setting "space" hash type for
+                                * only allow setting "space" hash flag on
                                 * plain directory.
                                 */
                                rc = mdt_object_striped(info, mo);
@@ -962,7 +962,7 @@ relock:
        if (!cos_incompat) {
                rc = mdt_object_striped(info, mc);
                if (rc < 0)
-                       GOTO(unlock_parent, rc);
+                       GOTO(put_child, rc);
 
                cos_incompat = rc;
                if (cos_incompat) {
@@ -1101,6 +1101,7 @@ unlock_parent:
        mdt_object_unlock(info, mp, parent_lh, rc);
 put_parent:
        mdt_object_put(info->mti_env, mp);
+       CFS_RACE_WAKEUP(OBD_FAIL_OBD_ZERO_NLINK_RACE);
         return rc;
 }