rc = llog_handle2ops(handle, &lop);
if (rc)
RETURN(rc);
+ LASSERT(lop);
if (lop->lop_write_rec == NULL)
RETURN(-EOPNOTSUPP);
struct thandle *handle)
{
struct dt_object *next = mdd_object_child(obj);
+ ENTRY;
LASSERT(lu_object_exists(mdd2lu_obj(obj)));
next->do_ops->do_ref_del(env, next, handle);
+ EXIT;
}
/* do NOT or the MAY_*'s, you'll get the weakest */
static inline void mdt_object_get(const struct lu_env *env,
struct mdt_object *o)
{
+ ENTRY;
lu_object_get(&o->mot_obj.mo_lu);
+ EXIT;
}
static inline void mdt_object_put(const struct lu_env *env,
struct mdt_object *o)
{
+ ENTRY;
lu_object_put(env, &o->mot_obj.mo_lu);
+ EXIT;
}
static inline const struct lu_fid *mdt_object_fid(struct mdt_object *o)
if (lu_object_exists(&o->mot_obj.mo_lu) == 1) {
rc = mo_attr_get(info->mti_env, next, ma);
} else {
- rc = mo_object_create(info->mti_env, next, &info->mti_spec,
- ma);
+ rc = mo_object_create(info->mti_env, next,
+ &info->mti_spec, ma);
}
if (rc == 0) {
/* return fid & attr to client. */
static int osd_inode_unlinked(const struct inode *inode)
{
- return inode->i_nlink == !!S_ISDIR(inode->i_mode);
+ /*
+ * This is modified by huanghua@lusterfs.com:
+ * i_nlink of an unlinked object is zero even if it is a dir.
+ return inode->i_nlink == !!S_ISDIR(inode->i_mode);
+ */
+ return inode->i_nlink == 0;
}
enum {
* The following is added by huanghua@clusterfs.com as
* a temporary hack, to remove the directory entry in
* "*OBJ_TEMP*". We will finally do not use this hack,
- * and at that time we will remove these code.
+ * and at that time we will remove these code under #if.
*/
+#if 1
osd_fid_build_name(fid, oti->oti_name);
oti->oti_str.name = oti->oti_name;
oti->oti_str.len = strlen(oti->oti_name);
obj->oo_inode->i_nlink = 1;
d_instantiate(dentry, obj->oo_inode);
result = dir->i_op->unlink(dir, dentry);
+ obj->oo_inode->i_nlink = 0;
+ mark_inode_dirty(obj->oo_inode);
dput(dentry);
} else
+#endif
iput(obj->oo_inode);
osd_trans_stop(env, th);
} else
run_test 43 "mds osc import failure during recovery; don't LBUG"
test_44() {
- mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices`
+ mdcdev=`awk '/MDT0000-mdc-/ {print $1}' $LPROC/devices`
[ "$mdcdev" ] || exit 2
for i in `seq 1 10`; do
#define OBD_FAIL_TGT_CONN_RACE 0x701
run_test 44 "race in target handle connect"
test_44b() {
- mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices`
+ mdcdev=`awk '/MDT0000-mdc-/ {print $1}' $LPROC/devices`
[ "$mdcdev" ] || exit 2
for i in `seq 1 10`; do
#define OBD_FAIL_TGT_DELAY_RECONNECT 0x704
# Handle failed close
test_45() {
- mdcdev=`awk '/-mdc-/ {print $1}' $LPROC/devices`
+ mdcdev=`awk '/MDT0000-mdc-/ {print $1}' $LPROC/devices`
[ "$mdcdev" ] || exit 2
$LCTL --device $mdcdev recover
run_test 48 "MDS->OSC failure during precreate cleanup (2824)"
test_50() {
- local oscdev=`grep ${ost1_svc}-osc-MDT $LPROC/devices | awk '{print $1}'`
+ local oscdev=`grep ${ost1_svc}-osc-MDT0000 $LPROC/devices | awk '{print $1}'`
[ "$oscdev" ] || return 1
$LCTL --device $oscdev recover && $LCTL --device $oscdev recover
# give the mds_lov_sync threads a chance to run