]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/gfs2/file.c
GFS2: Ensure uptodate inode size when using O_APPEND
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 8 Dec 2009 10:25:33 +0000 (10:25 +0000)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 8 Jan 2010 13:42:27 +0000 (13:42 +0000)
commit56aa616a03feca630d5afce647367a5d8cfc67b8
treea4b4feb0d2ac0f329b98748445adb90a6458a2e9
parent74d2e4f8d79ae0c4b6ec027958d5b18058662eea
GFS2: Ensure uptodate inode size when using O_APPEND

The VFS reads the inode size during generic_file_aio_write() but
with no locking around it. In order to get the expected result
from O_APPEND opens, this patch updated the inode size before
calling generic_file_aio_write()

There is of course still a race here, in that there is nothing to
prevent another node coming in and extending the file in the
mean time. On the other hand, when used with file locking this
will ensure that the expected results are obtained.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/file.c