Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e535e2efd295c3990bb9f654c8bb6bd176ebdc2b
Commit:     e535e2efd295c3990bb9f654c8bb6bd176ebdc2b
Parent:     30b8548f2c270c0205558fe4826a6ab8e7fe51ad
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 31 10:23:41 2007 -0700
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Tue Sep 11 11:39:46 2007 -0700

    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 <[EMAIL PROTECTED]>
---
 fs/ocfs2/alloc.c |    1 +
 fs/ocfs2/file.c  |    1 -
 2 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 4f51766..778a850 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);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 4ffa715..7e34e66 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -314,7 +314,6 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super 
*osb,
        }
 
        i_size_write(inode, new_i_size);
-       inode->i_blocks = ocfs2_align_bytes_to_sectors(new_i_size);
        inode->i_ctime = inode->i_mtime = CURRENT_TIME;
 
        di = (struct ocfs2_dinode *) fe_bh->b_data;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to