#endif
#include <lustre_fsfilt.h>
#include <lustre/lustre_lfsck_user.h>
+#include <lustre_fid.h>
#ifdef HAVE_QUOTA_SUPPORT
/* quota stuff */
return lu_object_fid(&obj->mod_obj.mo_lu);
}
+static inline int mdd_object_obf(const struct mdd_object *obj)
+{
+ return lu_fid_eq(mdo2fid(obj), &LU_OBF_FID);
+}
+
static inline cfs_umode_t mdd_object_type(const struct mdd_object *obj)
{
return lu_object_attr(&obj->mod_obj.mo_lu);
LASSERT(parent != NULL);
+ /*
+ * can not create child's lov_mds_md by access it
+ * thru .lustre path
+ */
+ if (mdd_object_obf(parent))
+ GOTO(out_oti, rc = -EBADFD);
+
_lmm = mdd_max_lmm_get(env, mdd);
if (_lmm == NULL)
GOTO(out_oti, rc = -ENOMEM);
mrename $DIR/.lustre $DIR/.lustre/fid/$fid/.lustre &&
error "rename .lustre to itself should fail."
+ $OPENFILE -f O_LOV_DELAY_CREATE:O_CREAT $DIR/$tfile-2
+ fid=$($LFS path2fid $DIR/$tfile-2)
+ echo "cp /etc/passwd $DIR/.lustre/fid/$fid"
+ cp /etc/passwd $DIR/.lustre/fid/$fid &&
+ error "create lov data thru .lustre should fail."
+ echo "cp /etc/passwd $DIR/$tfile-2"
+ cp /etc/passwd $DIR/$tfile-2 || error "copy to $DIR/$tfile-2 failed."
+ echo "diff /etc/passwd $DIR/.lustre/fid/$fid"
+ diff /etc/passwd $DIR/.lustre/fid/$fid ||
+ error "diff /etc/passwd $DIR/.lustre/fid/$fid failed."
+
echo "Open-by-FID succeeded"
}
run_test 154 "Open-by-FID"