X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_reint.c;h=62308a8beaab9a5f08eef97a80dcbc7ada3f4e58;hp=5c451c0396dfbc423568bd591bfccf81605c26bd;hb=81af631d07084074c6c0346435e7011a6b4582f7;hpb=0814d5077343953115f50982a2e93cebb29bda68;ds=sidebyside diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 5c451c0..62308a8 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -1504,6 +1504,13 @@ static int mdt_reint_migrate_internal(struct mdt_thread_info *info, if (IS_ERR(mold)) GOTO(out_unlock_parent, rc = PTR_ERR(mold)); + if (!mdt_object_exists(mold)) { + LU_OBJECT_DEBUG(D_INODE, info->mti_env, + &mold->mot_obj, + "object does not exist"); + GOTO(out_put_child, rc = -ENOENT); + } + if (mdt_object_remote(mold)) { CDEBUG(D_OTHER, "%s: source "DFID" is on the remote MDT\n", mdt_obd_name(info->mti_mdt), PFID(old_fid)); @@ -1987,6 +1994,13 @@ relock: if (IS_ERR(mold)) GOTO(out_unlock_parents, rc = PTR_ERR(mold)); + if (!mdt_object_exists(mold)) { + LU_OBJECT_DEBUG(D_INODE, info->mti_env, + &mold->mot_obj, + "object does not exist"); + GOTO(out_put_old, rc = -ENOENT); + } + /* Check if @mtgtdir is subdir of @mold, before locking child * to avoid reverse locking. */ if (mtgtdir != msrcdir) { @@ -2033,6 +2047,13 @@ relock: if (IS_ERR(mnew)) GOTO(out_put_old, rc = PTR_ERR(mnew)); + if (!mdt_object_exists(mnew)) { + LU_OBJECT_DEBUG(D_INODE, info->mti_env, + &mnew->mot_obj, + "object does not exist"); + GOTO(out_put_new, rc = -ENOENT); + } + if (mdt_object_remote(mnew)) { struct mdt_body *repbody;