Benjamin Marzinski b524fe646c [GFS2] flush the glock completely in inode_go_sync
Fix for bz #231910
When filemap_fdatawrite() is called on the inode mapping in data=ordered mode,
it will add the glock to the log. In inode_go_sync(), if you do the
gfs2_log_flush() before this, after the filemap_fdatawrite() call, the glock
and its associated data buffers will be on the log again. This means you can
demote a lock from exclusive, without having it flushed from the log. The
attached patch simply moves the gfs2_log_flush up to after the
filemap_fdatawrite() call.

Originally, I tried moving the gfs2_log_flush to after gfs2_meta_sync(), but
that caused me to trip the following assert.

GFS2: fsid=cypher-36:test.0: fatal: assertion "!buffer_busy(bh)" failed
GFS2: fsid=cypher-36:test.0:   function = gfs2_ail_empty_gl, file = fs/gfs2/glops.c, line = 61

It appears that gfs2_log_flush() puts some of the glocks buffers in the busy
state and the filemap_fdatawrite() call is necessary to flush them. This makes
me worry slightly that a related problem could happen because of moving the
gfs2_log_flush() after the initial filemap_fdatawrite(), but I assume that
gfs2_ail_empty_gl() would catch that case as well.

Signed-off-by: Benjamin E. Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2007-07-09 08:22:07 +01:00
..
2006-11-30 10:37:32 -05:00
2006-11-30 10:37:32 -05:00
2006-10-20 09:13:40 -04:00
2006-11-30 10:36:42 -05:00
2007-05-01 09:11:48 +01:00
2007-02-05 13:37:04 -05:00
2007-05-21 09:18:19 -07:00
2007-05-01 09:11:33 +01:00
2007-02-05 13:38:20 -05:00
2007-05-01 09:10:50 +01:00
2006-11-30 10:33:14 -05:00
2007-05-17 05:23:04 -07:00
2007-03-07 13:57:34 -05:00
2007-05-01 09:11:33 +01:00
2007-03-07 13:56:41 -05:00
2006-10-12 17:10:15 -04:00
2007-03-07 14:02:30 -05:00
2006-09-05 10:39:21 -04:00