Skip to content

Commit

Permalink
GFS2: Fix symlink creation race
Browse files Browse the repository at this point in the history
In certain cases symlinks can appear to have zero size if a lookup
on the inode occurs within a certain (very short) time after the
symlink has been created. The symlink is correctly created on disk
but appears to have zero size when stat()ed. This patch closes the
race and prevents incorrect sizes appearing.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Steven Whitehouse committed Apr 15, 2009
1 parent 7fa5d20 commit 5cf3252
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/gfs2/ops_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ static int gfs2_symlink(struct inode *dir, struct dentry *dentry,
ip = ghs[1].gh_gl->gl_object;

ip->i_disksize = size;
i_size_write(inode, size);

error = gfs2_meta_inode_buffer(ip, &dibh);

Expand Down

0 comments on commit 5cf3252

Please sign in to comment.