diff options
-rw-r--r-- | fs/gfs2/glops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index db908f697139..f88dcd925010 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -192,8 +192,11 @@ static void inode_go_sync(struct gfs2_glock *gl) | |||
192 | 192 | ||
193 | if (ip && !S_ISREG(ip->i_inode.i_mode)) | 193 | if (ip && !S_ISREG(ip->i_inode.i_mode)) |
194 | ip = NULL; | 194 | ip = NULL; |
195 | if (ip && test_and_clear_bit(GIF_SW_PAGED, &ip->i_flags)) | 195 | if (ip) { |
196 | unmap_shared_mapping_range(ip->i_inode.i_mapping, 0, 0); | 196 | if (test_and_clear_bit(GIF_SW_PAGED, &ip->i_flags)) |
197 | unmap_shared_mapping_range(ip->i_inode.i_mapping, 0, 0); | ||
198 | inode_dio_wait(&ip->i_inode); | ||
199 | } | ||
197 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) | 200 | if (!test_and_clear_bit(GLF_DIRTY, &gl->gl_flags)) |
198 | return; | 201 | return; |
199 | 202 | ||
@@ -410,6 +413,9 @@ static int inode_go_lock(struct gfs2_holder *gh) | |||
410 | return error; | 413 | return error; |
411 | } | 414 | } |
412 | 415 | ||
416 | if (gh->gh_state != LM_ST_DEFERRED) | ||
417 | inode_dio_wait(&ip->i_inode); | ||
418 | |||
413 | if ((ip->i_diskflags & GFS2_DIF_TRUNC_IN_PROG) && | 419 | if ((ip->i_diskflags & GFS2_DIF_TRUNC_IN_PROG) && |
414 | (gl->gl_state == LM_ST_EXCLUSIVE) && | 420 | (gl->gl_state == LM_ST_EXCLUSIVE) && |
415 | (gh->gh_state == LM_ST_EXCLUSIVE)) { | 421 | (gh->gh_state == LM_ST_EXCLUSIVE)) { |