Whamcloud - gitweb
LU-6158 mdt: always shrink_capsule in getxattr_all
[fs/lustre-release.git] / lustre / osp / osp_trans.c
index bcedee5..e700acf 100644 (file)
@@ -730,9 +730,6 @@ int osp_trans_update_request_create(struct thandle *th)
        oth->ot_our = our;
        our->our_th = oth;
 
-       if (oth->ot_super.th_sync)
-               oth->ot_our->our_flags |= UPDATE_FL_SYNC;
-
        return 0;
 }
 
@@ -985,9 +982,11 @@ static int osp_send_update_req(const struct lu_env *env,
                if (top_device->ld_obd->obd_recovering)
                        req->rq_allow_replay = 1;
 
-               osp_get_rpc_lock(osp);
+               if (osp->opd_connect_mdt)
+                       osp_get_rpc_lock(osp);
                rc = ptlrpc_queue_wait(req);
-               osp_put_rpc_lock(osp);
+               if (osp->opd_connect_mdt)
+                       osp_put_rpc_lock(osp);
                if ((rc == -ENOMEM && req->rq_set == NULL) ||
                    (req->rq_transno == 0 && !req->rq_committed)) {
                        if (args->oaua_update != NULL) {
@@ -1273,6 +1272,8 @@ int osp_trans_start(const struct lu_env *env, struct dt_device *dt,
 {
        struct osp_thandle      *oth = thandle_to_osp_thandle(th);
 
+       if (oth->ot_super.th_sync)
+               oth->ot_our->our_flags |= UPDATE_FL_SYNC;
        /* For remote thandle, if there are local thandle, start it here*/
        if (is_only_remote_trans(th) && oth->ot_storage_th != NULL)
                return dt_trans_start(env, oth->ot_storage_th->th_dev,
@@ -1322,6 +1323,7 @@ int osp_trans_stop(const struct lu_env *env, struct dt_device *dt,
        }
 
        if (!osp->opd_connect_mdt) {
+               osp_trans_callback(env, oth, th->th_result);
                rc = osp_send_update_req(env, osp, oth->ot_our);
                GOTO(out, rc);
        }