Whamcloud - gitweb
LU-4611 osd: improve credits calculation
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_quota.c
index c53d6f8..feda48d 100644 (file)
@@ -866,6 +866,7 @@ static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt,
        struct inode            *inode;
        int                      rc;
        struct iam_container    *bag = &(osd_dt_obj(dt))->oo_dir->od_container;
+       struct lu_buf           *lb = &osd_oti_get(env)->oti_buf;
        ENTRY;
 
        LASSERT(bag->ic_root_bh != NULL);
@@ -897,7 +898,9 @@ static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt,
        inode = osd_dt_obj(dt)->oo_inode;
        LASSERT(inode);
 
-       rc = dt_declare_record_write(env, dt, NULL, 0, th);
+       /* iam_lfix_create() writes two blocks at the beginning */
+       lb->lb_len = osd_sb(osd)->s_blocksize * 2;
+       rc = dt_declare_record_write(env, dt, lb, 0, th);
        if (rc)
                GOTO(out, rc);