GFS2: O_TRUNC not working on stuffed files across cluster
authorBob Peterson <rpeterso@redhat.com>
Thu, 24 Jun 2010 23:15:09 +0000 (19:15 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 15 Jul 2010 08:05:17 +0000 (09:05 +0100)
This patch replaces a statement that got dropped out by accident.
Without the patch, truncates on stuffed (very small) files cause
those files to have an unpredictable size.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/bmap.c

index 4a48c0f4b40275bce81f5c4b5fb40784a45a00bc..84da64b551b2c1170f4e68550ead612ed6fd7b41 100644 (file)
@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size)
 
        if (gfs2_is_stuffed(ip)) {
                u64 dsize = size + sizeof(struct gfs2_inode);
+               ip->i_disksize = size;
                ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
                gfs2_trans_add_bh(ip->i_gl, dibh, 1);
                gfs2_dinode_out(ip, dibh->b_data);