]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
GFS2: Fix symlink creation race
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 31 Mar 2009 15:06:27 +0000 (16:06 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 15 Apr 2009 09:15:38 +0000 (10:15 +0100)
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>
fs/gfs2/ops_inode.c

index abd5429ae2856a9d275ca75bd9273598994e94f1..1c70fa5168d6aa46ddf872f326a2a1399bee981a 100644 (file)
@@ -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);