Details
-
Bug
-
Resolution: Not a Bug
-
Minor
-
None
-
None
-
3
-
9223372036854775807
Description
In mdt_create():
if (!mdt_object_remote(parent)) { mdt_object_unlock(info, parent, lh, 1); mdt_lock_pdo_init(lh, LCK_PW, &rr->rr_name); rc = mdt_reint_object_lock(info, parent, lh, MDS_INODELOCK_UPDATE, true); if (rc) GOTO(put_child, rc); } ... put_child: mdt_object_put(info->mti_env, child); unlock_parent: mdt_object_unlock(info, parent, lh, rc); put_parent: mdt_object_put(info->mti_env, parent); RETURN(rc);
So if we cannot lock parent we jump to put child and then unlock parent? that sounds wrong.
this is not a bug IMO, mdt_object_unlock() is safe to call multiple times, because it will clear lock handle after unlock, so this GOTO is to make sure child is put, and it's written this way to simplify failure cleanup.