written = lustre_fwrite(mds->mds_rcvd_filp, (char *)mcd, sizeof(*mcd),
&off);
CDEBUG(D_INODE, "wrote trans #"LPD64" for client %s at #%d: written = "
- "%d\n", last_rcvd, mcd->mcd_uuid, med->med_off, written);
+ LPSZ"\n", last_rcvd, mcd->mcd_uuid, med->med_off, written);
if (written == sizeof(*mcd))
GOTO(out, rc = 0);
CDEBUG(D_INODE, "parent ino %lu name %s mode %o\n",
dir->i_ino, rec->ur_name, rec->ur_mode);
- ldlm_lock_dump_handle(&lockh);
+ ldlm_lock_dump_handle(D_OTHER, &lockh);
down(&dir->i_sem);
dchild = lookup_one_len(rec->ur_name, de, rec->ur_namelen - 1);
rec->ur_mode |= S_ISGID;
}
+ if (rec->ur_fid2->id)
+ dchild->d_fsdata = (void *)(unsigned long)rec->ur_fid2->id;
+ else
+ LASSERT(!(rec->ur_opcode & REINT_REPLAYING));
+
/* From here on, we must exit via a path that calls mds_finish_transno,
* so that we release the mds_transno_sem (and, in the case of success,
* update the transno correctly). out_create_commit and
GOTO(out_transno_dchild, rc = -EINVAL);
}
+ /* In case we stored the desired inum in here, we want to clean up.
+ * We also do this in the out_transno_dchild block, for the error cases.
+ */
+ dchild->d_fsdata = NULL;
+
if (rc) {
CDEBUG(D_INODE, "error during create: %d\n", rc);
GOTO(out_create_commit, rc);
ATTR_MTIME | ATTR_CTIME;
if (rec->ur_fid2->id) {
- LASSERT(rec->ur_opcode & REINT_REPLAYING);
+ LASSERT(rec->ur_fid2->id == inode->i_ino);
inode->i_generation = rec->ur_fid2->generation;
/* Dirtied and committed by the upcoming setattr. */
- CDEBUG(D_INODE, "recreated ino %lu with gen %lu\n",
+ CDEBUG(D_INODE, "recreated ino %lu with gen %x\n",
inode->i_ino, inode->i_generation);
} else {
- CDEBUG(D_INODE, "created ino %lu\n", inode->i_ino);
+ CDEBUG(D_INODE, "created ino %lu with gen %x\n",
+ inode->i_ino, inode->i_generation);
}
rc = fsfilt_setattr(obd, dchild, handle, &iattr);
return 0;
out_transno_dchild:
+ dchild->d_fsdata = NULL;
/* Need to release the transno lock, and then put the dchild. */
LASSERT(rc);
mds_finish_transno(mds, handle, req, rc);
dir = de->d_inode;
inode = dchild->d_inode;
- CDEBUG(D_INODE, "parent ino %lu\n", dir->i_ino);
+ DEBUG_REQ(D_INODE, req, "parent ino %lu, child ino %lu\n", dir->i_ino,
+ inode ? inode->i_ino : 0);
if (!inode) {
if (rec->ur_opcode & REINT_REPLAYING) {
GOTO(out_link_src_put, rc = -EIO);
}
} else {
- ldlm_lock_dump_handle(&srclockh);
+ ldlm_lock_dump_handle(D_OTHER, &srclockh);
}
de_tgt_dir = mds_fid2dentry(mds, rec->ur_fid2, NULL);
GOTO(out_link_tgt_dir_put, rc = -EIO);
}
} else {
- ldlm_lock_dump_handle(&tgtlockh);
+ ldlm_lock_dump_handle(D_OTHER, &tgtlockh);
}
down(&de_tgt_dir->d_inode->i_sem);
GOTO(out_rename_srcput, rc = -EIO);
}
} else {
- ldlm_lock_dump_handle(&srclockh);
+ ldlm_lock_dump_handle(D_OTHER, &srclockh);
}
de_tgtdir = mds_fid2dentry(mds, rec->ur_fid2, NULL);
GOTO(out_rename_tgtput, rc = -EIO);
}
} else {
- ldlm_lock_dump_handle(&tgtlockh);
+ ldlm_lock_dump_handle(D_OTHER, &tgtlockh);
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))