Bob Glossman (Inactive)
added a comment - patch for master: http://review.whamcloud.com/4405
port of http://review.whamcloud.com/#change,4197 . Context too different to just be cherry picked directly.
I think the problem fixed by review-4136 existed for long time (since 2.1), so probably it's not the reason of the crash here, but we should land it to master at least.
Liang Zhen (Inactive)
added a comment - I think the problem fixed by review-4136 existed for long time (since 2.1), so probably it's not the reason of the crash here, but we should land it to master at least.
Liang, Oleg, what about http://review.whamcloud.com/4136? That patch didn't land to b2_3. Was that intended to fix the MDS crash, or is it a secondary problem that doesn't need to be fixed for 2.3.0?
Andreas Dilger
added a comment - Liang, Oleg, what about http://review.whamcloud.com/4136? That patch didn't land to b2_3. Was that intended to fix the MDS crash, or is it a secondary problem that doesn't need to be fixed for 2.3.0?
Liang Zhen (Inactive)
added a comment - I've posted another patch for this: http://review.whamcloud.com/#change,4197
it should have fixed something but not sure if it can fix this bug.
I found something suspicious in mdd_rename(), but I'm not expert of this, so please check this for me:
/* Remove old target object
* For tobj is remote case cmm layer has processed
* and set tobj to NULL then. So when tobj is NOT NULL,
* it must be local one.
*/
if (tobj && mdd_object_exists(mdd_tobj)) {
mdd_write_lock(env, mdd_tobj, MOR_TGT_CHILD);
if (mdd_is_dead_obj(mdd_tobj)) {
mdd_write_unlock(env, mdd_tobj);
/* shld not be dead, something is wrong */
CERROR("tobj is dead, something is wrong\n");
rc = -EINVAL;
goto cleanup;
}
mdo_ref_del(env, mdd_tobj, handle);
/* Remove dot reference. */
if (is_dir)
mdo_ref_del(env, mdd_tobj, handle);
la->la_valid = LA_CTIME;
rc = mdd_attr_check_set_internal(env, mdd_tobj, la, handle, 0);
if (rc)
GOTO(fixup_tpobj, rc);
rc = mdd_finish_unlink(env, mdd_tobj, ma, handle);
mdd_write_unlock(env, mdd_tobj);
if (rc)
GOTO(fixup_tpobj, rc);
If mdd_attr_check_set_internal() or mdd_finish_unlink() failed, it will try to revert changes by re-inserting @mdd_tobj into @mdd_tpobj again without fix refcount of @mdd_tobj:
So if everything got reverted, refcount on target object will be wrong.
Is this analysis correct?
Liang Zhen (Inactive)
added a comment - - edited I found something suspicious in mdd_rename(), but I'm not expert of this, so please check this for me:
/* Remove old target object
* For tobj is remote case cmm layer has processed
* and set tobj to NULL then. So when tobj is NOT NULL,
* it must be local one.
*/
if (tobj && mdd_object_exists(mdd_tobj)) {
mdd_write_lock(env, mdd_tobj, MOR_TGT_CHILD);
if (mdd_is_dead_obj(mdd_tobj)) {
mdd_write_unlock(env, mdd_tobj);
/* shld not be dead, something is wrong */
CERROR("tobj is dead, something is wrong\n");
rc = -EINVAL;
goto cleanup;
}
mdo_ref_del(env, mdd_tobj, handle);
/* Remove dot reference. */
if (is_dir)
mdo_ref_del(env, mdd_tobj, handle);
la->la_valid = LA_CTIME;
rc = mdd_attr_check_set_internal(env, mdd_tobj, la, handle, 0);
if (rc)
GOTO(fixup_tpobj, rc);
rc = mdd_finish_unlink(env, mdd_tobj, ma, handle);
mdd_write_unlock(env, mdd_tobj);
if (rc)
GOTO(fixup_tpobj, rc);
If mdd_attr_check_set_internal() or mdd_finish_unlink() failed, it will try to revert changes by re-inserting @mdd_tobj into @mdd_tpobj again without fix refcount of @mdd_tobj:
fixup_tpobj:
if (rc) {
rc2 = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle,
BYPASS_CAPA);
if (rc2)
CWARN("tp obj fix error %d\n",rc2);
if (mdd_tobj && mdd_object_exists(mdd_tobj) &&
!mdd_is_dead_obj(mdd_tobj)) {
rc2 = __mdd_index_insert(env, mdd_tpobj,
mdo2fid(mdd_tobj), tname,
is_dir, handle,
BYPASS_CAPA);
if (rc2)
CWARN("tp obj fix error %d\n",rc2);
}
}
So if everything got reverted, refcount on target object will be wrong.
Is this analysis correct?
The lustre debug dump log. Though not much useful for this LBUG. But it seems there are some lnet error, Liang, could you please have a look?
Di Wang
added a comment - The lustre debug dump log. Though not much useful for this LBUG. But it seems there are some lnet error, Liang, could you please have a look?
duplicate of
LU-3022