[Ocfs2-commits] mfasheh commits r2249 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon May 16 19:27:26 CDT 2005
Author: mfasheh
Signed-off-by: jlbec
Date: 2005-05-16 19:27:24 -0500 (Mon, 16 May 2005)
New Revision: 2249
Modified:
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/suballoc.c
Log:
* truncate was mixing up blocks and clusters, fix that.
Signed-off-by: jlbec
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-05-16 19:32:02 UTC (rev 2248)
+++ trunk/fs/ocfs2/alloc.c 2005-05-17 00:27:24 UTC (rev 2249)
@@ -997,7 +997,9 @@
* we need to record the offset of the next level extent block
* as we may overwrite it. */
if (!el->l_tree_depth)
- delete_blk = el->l_recs[i].e_blkno + el->l_recs[i].e_clusters;
+ delete_blk = el->l_recs[i].e_blkno
+ + ocfs2_clusters_to_blocks(osb->sb,
+ el->l_recs[i].e_clusters);
else
next_eb = el->l_recs[i].e_blkno;
@@ -1082,8 +1084,9 @@
next_eb = el->l_recs[i].e_blkno;
/* bottom-most block requires us to delete data.*/
if (!el->l_tree_depth)
- delete_blk = el->l_recs[i].e_blkno +
- el->l_recs[i].e_clusters;
+ delete_blk = el->l_recs[i].e_blkno
+ + ocfs2_clusters_to_blocks(osb->sb,
+ el->l_recs[i].e_clusters);
if (!el->l_recs[i].e_clusters) {
el->l_recs[i].e_cpos = 0;
el->l_recs[i].e_blkno = 0;
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-05-16 19:32:02 UTC (rev 2248)
+++ trunk/fs/ocfs2/suballoc.c 2005-05-17 00:27:24 UTC (rev 2249)
@@ -1498,6 +1498,10 @@
mlog_entry_void();
+ /* This is expensive. We can safely remove once this stuff has
+ * gotten tested really well. */
+ BUG_ON(start_blk != ocfs2_clusters_to_blocks(bitmap_inode->i_sb, ocfs2_blocks_to_clusters(bitmap_inode->i_sb, start_blk)));
+
fe = (ocfs2_dinode *) bitmap_bh->b_data;
ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
More information about the Ocfs2-commits
mailing list