diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-09-07 11:33:25 +0200 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-10-21 13:39:41 +0200 |
commit | b5b24d7aeb9608935786369ac2d3e9f362877d55 (patch) | |
tree | 2043123df7a6e6ca367b24cb3442ee50314cdee0 /fs/gfs2/file.c | |
parent | GFS2: Use cached rgrp in gfs2_rlist_add() (diff) | |
download | linux-b5b24d7aeb9608935786369ac2d3e9f362877d55.tar.xz linux-b5b24d7aeb9608935786369ac2d3e9f362877d55.zip |
GFS2: Fix AIL flush issue during fsync
Unfortunately, it is not enough to just ignore locked buffers during
the AIL flush from fsync. We need to be able to ignore all buffers
which are locked, dirty or pinned at this stage as they might have
been added subsequent to the log flush earlier in the fsync function.
In addition, this means that we no longer need to rely on i_mutex to
keep out writes during fsync, so we can, as a side-effect, remove
that protection too.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Tested-By: Abhijith Das <adas@redhat.com>
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r-- | fs/gfs2/file.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 3467f3662149..3b65f67bb38e 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -593,16 +593,12 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end, sync_state &= ~I_DIRTY_SYNC; if (sync_state) { - mutex_lock(&inode->i_mutex); ret = sync_inode_metadata(inode, 1); - if (ret) { - mutex_unlock(&inode->i_mutex); + if (ret) return ret; - } if (gfs2_is_jdata(ip)) filemap_write_and_wait(mapping); - gfs2_ail_flush(ip->i_gl); - mutex_unlock(&inode->i_mutex); + gfs2_ail_flush(ip->i_gl, 1); } if (mapping->nrpages) |