Whamcloud - gitweb
LU-5031 tests: obdfilter-survey fixes
[fs/lustre-release.git] / lustre / fid / fid_store.c
index 5ae8307..9585732 100644 (file)
@@ -95,8 +95,7 @@ int seq_update_cb_add(struct thandle *th, struct lu_server_seq *seq)
        dcb            = &ccb->suc_cb;
        dcb->dcb_func  = seq_update_cb;
        CFS_INIT_LIST_HEAD(&dcb->dcb_linkage);
-       strncpy(dcb->dcb_name, "seq_update_cb", MAX_COMMIT_CB_STR_LEN);
-       dcb->dcb_name[MAX_COMMIT_CB_STR_LEN - 1] = '\0';
+       strlcpy(dcb->dcb_name, "seq_update_cb", sizeof(dcb->dcb_name));
 
        rc = dt_trans_cb_add(th, dcb);
        if (rc)
@@ -121,8 +120,11 @@ int seq_store_update(const struct lu_env *env, struct lu_server_seq *seq,
        if (IS_ERR(th))
                RETURN(PTR_ERR(th));
 
+       /* Store ranges in le format. */
+       range_cpu_to_le(&info->sti_space, &seq->lss_space);
+
        rc = dt_declare_record_write(env, seq->lss_obj,
-                                    sizeof(struct lu_seq_range), 0, th);
+                                    seq_store_buf(info), 0, th);
        if (rc)
                GOTO(exit, rc);
 
@@ -138,9 +140,6 @@ int seq_store_update(const struct lu_env *env, struct lu_server_seq *seq,
        if (rc)
                GOTO(exit, rc);
 
-       /* Store ranges in le format. */
-       range_cpu_to_le(&info->sti_space, &seq->lss_space);
-
        rc = dt_record_write(env, seq->lss_obj, seq_store_buf(info), &pos, th);
        if (rc) {
                CERROR("%s: Can't write space data, rc %d\n",