From cb48c90e1b412b390b33cafe5746b5c678c3ecf7 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Tue, 6 Nov 2012 00:49:28 -0600 Subject: [PATCH] --- yaml --- r: 335448 b: refs/heads/master c: 3d1626889a64bd5a661544d582036a0a02104a60 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/gfs2/file.c | 12 +++++------- trunk/fs/gfs2/super.c | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index ef620144f75e..1b2daff70f4b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 076f0faa764ab3a5a32fc726ae05e2de0e66151d +refs/heads/master: 3d1626889a64bd5a661544d582036a0a02104a60 diff --git a/trunk/fs/gfs2/file.c b/trunk/fs/gfs2/file.c index 377a68dbd066..e056b4ce4877 100644 --- a/trunk/fs/gfs2/file.c +++ b/trunk/fs/gfs2/file.c @@ -516,15 +516,13 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) struct gfs2_holder i_gh; int error; - gfs2_holder_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); - error = gfs2_glock_nq(&i_gh); - if (error == 0) { - file_accessed(file); - gfs2_glock_dq(&i_gh); - } - gfs2_holder_uninit(&i_gh); + error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, + &i_gh); if (error) return error; + /* grab lock to update inode */ + gfs2_glock_dq_uninit(&i_gh); + file_accessed(file); } vma->vm_ops = &gfs2_vm_ops; diff --git a/trunk/fs/gfs2/super.c b/trunk/fs/gfs2/super.c index bc737261f234..d6488674d916 100644 --- a/trunk/fs/gfs2/super.c +++ b/trunk/fs/gfs2/super.c @@ -810,7 +810,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) return; } need_unlock = 1; - } + } else if (WARN_ON_ONCE(ip->i_gl->gl_state != LM_ST_EXCLUSIVE)) + return; if (current->journal_info == NULL) { ret = gfs2_trans_begin(sdp, RES_DINODE, 0);