Skip to content

Commit a8bf2bc

Browse files
AstralBobswhiteho
authored andcommitted
GFS2: O_TRUNC not working on stuffed files across cluster
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>
1 parent 2f7989e commit a8bf2bc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/gfs2/bmap.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size)
10411041

10421042
if (gfs2_is_stuffed(ip)) {
10431043
u64 dsize = size + sizeof(struct gfs2_inode);
1044+
ip->i_disksize = size;
10441045
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
10451046
gfs2_trans_add_bh(ip->i_gl, dibh, 1);
10461047
gfs2_dinode_out(ip, dibh->b_data);

0 commit comments

Comments
 (0)