From e535e2efd295c3990bb9f654c8bb6bd176ebdc2b Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 31 Aug 2007 10:23:41 -0700 Subject: ocfs2: Fix calculation of i_blocks during truncate We were setting i_blocks too early - before truncating any allocation. Correct things to set i_blocks after the allocation change. Signed-off-by: Mark Fasheh --- fs/ocfs2/alloc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/ocfs2/alloc.c') diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 4f517665c9a..778a850b463 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -5602,6 +5602,7 @@ static int ocfs2_do_truncate(struct ocfs2_super *osb, clusters_to_del; spin_unlock(&OCFS2_I(inode)->ip_lock); le32_add_cpu(&fe->i_clusters, -clusters_to_del); + inode->i_blocks = ocfs2_inode_sector_count(inode); status = ocfs2_trim_tree(inode, path, handle, tc, clusters_to_del, &delete_blk); -- cgit v1.2.3