Whamcloud - gitweb
LU-4952 osd: wrong paramters for dmu_tx_hold_write 79/10079/2
authorLiang Zhen <liang.zhen@intel.com>
Thu, 24 Apr 2014 12:19:53 +0000 (20:19 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 6 May 2014 03:15:26 +0000 (03:15 +0000)
osd_declare_write_commit may pass wrong parameters to
dmu_tx_hold_write when there are multiple IO fragments.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Change-Id: Ic7bd5ce1f42e7777c1a07eb4b9d19f8477da66a0
Reviewed-on: http://review.whamcloud.com/10079
Tested-by: Jenkins
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
lustre/osd-zfs/osd_io.c

index b315807..98e359e 100644 (file)
@@ -585,20 +585,21 @@ static int osd_declare_write_commit(const struct lu_env *env,
                        continue;
                }
 
                        continue;
                }
 
-               dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
-
+               dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object,
+                                 offset, size);
                /* estimating space that will be consumed by a write is rather
                 * complicated with ZFS. As a consequence, we don't account for
                 * indirect blocks and quota overrun will be adjusted once the
                 * operation is committed, if required. */
                space += osd_count_not_mapped(obj, offset, size);
 
                /* estimating space that will be consumed by a write is rather
                 * complicated with ZFS. As a consequence, we don't account for
                 * indirect blocks and quota overrun will be adjusted once the
                 * operation is committed, if required. */
                space += osd_count_not_mapped(obj, offset, size);
 
-               offset = lnb->lnb_file_offset;
-               size = lnb->len;
+               offset = lnb[i].lnb_file_offset;
+               size = lnb[i].len;
        }
 
        if (size) {
        }
 
        if (size) {
-               dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
+               dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object,
+                                 offset, size);
                space += osd_count_not_mapped(obj, offset, size);
        }
 
                space += osd_count_not_mapped(obj, offset, size);
        }