Commit a8bf2bc2 authored by Bob Peterson's avatar Bob Peterson Committed by Steven Whitehouse

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: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 2f7989ef
...@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size) ...@@ -1041,6 +1041,7 @@ static int trunc_start(struct gfs2_inode *ip, u64 size)
if (gfs2_is_stuffed(ip)) { if (gfs2_is_stuffed(ip)) {
u64 dsize = size + sizeof(struct gfs2_inode); u64 dsize = size + sizeof(struct gfs2_inode);
ip->i_disksize = size;
ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME;
gfs2_trans_add_bh(ip->i_gl, dibh, 1); gfs2_trans_add_bh(ip->i_gl, dibh, 1);
gfs2_dinode_out(ip, dibh->b_data); gfs2_dinode_out(ip, dibh->b_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment