Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-1678 mdd: don't create LOV EA by going thru .lustre path
[fs/lustre-release.git]
/
lustre
/
mdd
/
mdd_lov.c
diff --git
a/lustre/mdd/mdd_lov.c
b/lustre/mdd/mdd_lov.c
index
1b874b5
..
df20c2a
100644
(file)
--- a/
lustre/mdd/mdd_lov.c
+++ b/
lustre/mdd/mdd_lov.c
@@
-463,6
+463,13
@@
int mdd_lov_create(const struct lu_env *env, struct mdd_device *mdd,
LASSERT(parent != NULL);
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);
_lmm = mdd_max_lmm_get(env, mdd);
if (_lmm == NULL)
GOTO(out_oti, rc = -ENOMEM);
@@
-589,10
+596,8
@@
out_ids:
* destroy objects on OSS.
*/
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
* destroy objects on OSS.
*/
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
- struct mdd_object *obj, struct lu_attr *la,
- struct lov_mds_md *lmm, int lmm_size,
- struct llog_cookie *logcookies,
- int log_unlink)
+ struct mdd_object *obj, struct lu_attr *la,
+ struct md_attr *ma, int log_unlink)
{
struct obd_device *obd = mdd2obd_dev(mdd);
struct obd_export *lov_exp = obd->u.mds.mds_lov_exp;
{
struct obd_device *obd = mdd2obd_dev(mdd);
struct obd_export *lov_exp = obd->u.mds.mds_lov_exp;
@@
-600,7
+605,10
@@
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
struct obd_trans_info *oti = &mdd_env_info(env)->mti_oti;
struct obdo *oa = &mdd_env_info(env)->mti_oa;
struct lu_site *site = mdd2lu_dev(mdd)->ld_site;
struct obd_trans_info *oti = &mdd_env_info(env)->mti_oti;
struct obdo *oa = &mdd_env_info(env)->mti_oa;
struct lu_site *site = mdd2lu_dev(mdd)->ld_site;
- int rc;
+ struct lov_mds_md *lmm = ma->ma_lmm;
+ int lmm_size = ma->ma_lmm_size;
+ struct llog_cookie *logcookies = ma->ma_cookie;
+ int rc;
ENTRY;
if (lmm_size == 0)
ENTRY;
if (lmm_size == 0)
@@
-626,6
+634,9
@@
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
oti->oti_logcookies = logcookies;
}
oti->oti_logcookies = logcookies;
}
+ if (!(ma->ma_attr_flags & MDS_UNLINK_DESTROY))
+ oa->o_flags = OBD_FL_DELORPHAN;
+
CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
oa->o_id);
CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
oa->o_id);
@@
-685,11
+696,10
@@
int mdd_lov_destroy(const struct lu_env *env, struct mdd_device *mdd,
RETURN(rc);
}
RETURN(rc);
}
- if (ma->ma_valid & MA_COOKIE)
- rc = mdd_lovobj_unlink(env, mdd, obj, la,
- ma->ma_lmm, ma->ma_lmm_size,
- ma->ma_cookie, 1);
- RETURN(rc);
+ if (ma->ma_valid & MA_COOKIE)
+ rc = mdd_lovobj_unlink(env, mdd, obj, la, ma, 1);
+
+ RETURN(rc);
}
int mdd_declare_unlink_log(const struct lu_env *env, struct mdd_object *obj,
}
int mdd_declare_unlink_log(const struct lu_env *env, struct mdd_object *obj,
@@
-779,8
+789,8
@@
int mdd_log_op_setattr(struct obd_device *obd, __u32 uid, __u32 gid,
/* write setattr log */
ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
/* write setattr log */
ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
-
rc = llog_add(
ctxt, &lsr->lsr_hdr, lsm, logcookies,
-
cookies_size / sizeof(struct llog_cookie));
+
rc = llog_add(NULL,
ctxt, &lsr->lsr_hdr, lsm, logcookies,
+ cookies_size / sizeof(struct llog_cookie));
llog_ctxt_put(ctxt);
llog_ctxt_put(ctxt);