GFS2: Fix bug trap and journaled data fsync
Journaled data requires that a complete flush of all dirty data for the file is done, in order that the ail flush which comes after will succeed. Also the recently enhanced bug trap can trigger falsely in case an ail flush from fsync races with a page read. This updates the bug trap such that it will ignore buffers which are locked and only trigger on dirty and/or pinned buffers when the ail flush is run from fsync. The original bug trap is retained when ail flush is run from ->go_sync() Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
@ -590,6 +590,8 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
return ret;
|
||||
}
|
||||
if (gfs2_is_jdata(ip))
|
||||
filemap_write_and_wait(mapping);
|
||||
gfs2_ail_flush(ip->i_gl);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
}
|
||||
|
Reference in New Issue
Block a user