From a0118a60ec0621ac57f0f7e53a13622f70067143 Mon Sep 17 00:00:00 2001 From: huanghua Date: Tue, 15 Aug 2006 10:02:43 +0000 Subject: [PATCH] fixed: (1) passed wrong lmm_size to mdd_get_md(); (2) handle -ENODATA error --- lustre/mdd/mdd_handler.c | 7 ++++--- lustre/mdd/mdd_lov.c | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 00a9806..b3f3ccd 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -237,9 +237,9 @@ static int __mdd_lmm_get(const struct lu_context *ctxt, RETURN(rc); } -static int mdd_attr_get_internal (const struct lu_context *ctxt, - struct mdd_object *mdd_obj, - struct md_attr *ma) +static int mdd_attr_get_internal(const struct lu_context *ctxt, + struct mdd_object *mdd_obj, + struct md_attr *ma) { int rc = 0; ENTRY; @@ -581,6 +581,7 @@ static int __mdd_xattr_set(const struct lu_context *ctxt, struct mdd_object *o, { struct dt_object *next; int rc = 0; + ENTRY; LASSERT(lu_object_exists(ctxt, mdd2lu_obj(o))); next = mdd_object_child(o); diff --git a/lustre/mdd/mdd_lov.c b/lustre/mdd/mdd_lov.c index 99fa43c..656d9dc 100644 --- a/lustre/mdd/mdd_lov.c +++ b/lustre/mdd/mdd_lov.c @@ -222,6 +222,8 @@ static int mdd_lov_set_dir_md(const struct lu_context *ctxt, lum->lmm_stripe_size == (typeof(lum->lmm_stripe_size))(-1)){ rc = mdd_xattr_set_txn(ctxt, obj, NULL, 0, MDS_LOV_MD_NAME, 0, handle); + if (rc == -ENODATA) + rc = 0; CDEBUG(D_INFO, "delete lov ea of "DFID" rc %d \n", PFID(mdo2fid(obj)), rc); } else { @@ -364,6 +366,7 @@ int mdd_lov_create(const struct lu_context *ctxt, struct mdd_device *mdd, struct lov_mds_md *__lmm; int __lmm_size, returned_lmm_size; __lmm_size = mdd_lov_mdsize(ctxt, mdd); + returned_lmm_size = __lmm_size; OBD_ALLOC(__lmm, __lmm_size); if (__lmm == NULL) -- 1.8.3.1