From: Steven Whitehouse Date: Tue, 31 Mar 2009 15:06:27 +0000 (+0100) Subject: GFS2: Fix symlink creation race X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5cf32524de745c56e1411d63eccf23fef1709d73;p=linux-beck.git GFS2: Fix symlink creation race 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 --- diff --git a/fs/gfs2/ops_inode.c b/fs/gfs2/ops_inode.c index abd5429ae285..1c70fa5168d6 100644 --- a/fs/gfs2/ops_inode.c +++ b/fs/gfs2/ops_inode.c @@ -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);