From: wang di Date: Tue, 21 Jul 2015 08:26:31 +0000 (-0700) Subject: LU-6846 osd: reset do_body_ops after creation X-Git-Tag: 2.7.58~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=037759bc49ce7f6adc9acb4a748a25c0f4c4ab64;ds=sidebyside LU-6846 osd: reset do_body_ops after creation Reset the do_body_ops from osd_body_ops_new to osd_body_ops after object creation succeeds. Otherwise in OUT handler, if creation the llog object and write records to the llog object are in the same transaction(one updates handling process), the object will not have create do_body_ops in write update. Signed-off-by: wang di Change-Id: Id45f1a29572faadc381194f45a980eb58d193e93 Reviewed-on: http://review.whamcloud.com/15595 Tested-by: Jenkins Reviewed-by: Alex Zhuravlev Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 41b79fd..8c2486c 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2283,9 +2283,11 @@ static int osd_object_create(const struct lu_env *env, struct dt_object *dt, RETURN(-EPERM); result = __osd_object_create(info, obj, attr, hint, dof, th); - if (result == 0) + if (result == 0) { result = __osd_oi_insert(env, obj, fid, th); - + if (obj->oo_dt.do_body_ops == &osd_body_ops_new) + obj->oo_dt.do_body_ops = &osd_body_ops; + } LASSERT(ergo(result == 0, dt_object_exists(dt) && !dt_object_remote(dt))); @@ -2636,6 +2638,8 @@ static int osd_object_ea_create(const struct lu_env *env, struct dt_object *dt, fid, OI_CHECK_FLD) ? LMAC_FID_ON_OST : 0, 0); } + if (obj->oo_dt.do_body_ops == &osd_body_ops_new) + obj->oo_dt.do_body_ops = &osd_body_ops; } if (result == 0)