Whamcloud - gitweb
LU-6846 osd: reset do_body_ops after creation 95/15595/4
authorwang di <di.wang@intel.com>
Tue, 21 Jul 2015 08:26:31 +0000 (01:26 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 15 Aug 2015 11:20:44 +0000 (11:20 +0000)
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 <di.wang@intel.com>
Change-Id: Id45f1a29572faadc381194f45a980eb58d193e93
Reviewed-on: http://review.whamcloud.com/15595
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_handler.c

index 41b79fd..8c2486c 100644 (file)
@@ -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)