diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/file.c | 12 | ||||
-rw-r--r-- | fs/gfs2/super.c | 3 |
2 files changed, 7 insertions, 8 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 377a68dbd066..e056b4ce4877 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -516,15 +516,13 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) | |||
516 | struct gfs2_holder i_gh; | 516 | struct gfs2_holder i_gh; |
517 | int error; | 517 | int error; |
518 | 518 | ||
519 | gfs2_holder_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | 519 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, |
520 | error = gfs2_glock_nq(&i_gh); | 520 | &i_gh); |
521 | if (error == 0) { | ||
522 | file_accessed(file); | ||
523 | gfs2_glock_dq(&i_gh); | ||
524 | } | ||
525 | gfs2_holder_uninit(&i_gh); | ||
526 | if (error) | 521 | if (error) |
527 | return error; | 522 | return error; |
523 | /* grab lock to update inode */ | ||
524 | gfs2_glock_dq_uninit(&i_gh); | ||
525 | file_accessed(file); | ||
528 | } | 526 | } |
529 | vma->vm_ops = &gfs2_vm_ops; | 527 | vma->vm_ops = &gfs2_vm_ops; |
530 | 528 | ||
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index bc737261f234..d6488674d916 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -810,7 +810,8 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) | |||
810 | return; | 810 | return; |
811 | } | 811 | } |
812 | need_unlock = 1; | 812 | need_unlock = 1; |
813 | } | 813 | } else if (WARN_ON_ONCE(ip->i_gl->gl_state != LM_ST_EXCLUSIVE)) |
814 | return; | ||
814 | 815 | ||
815 | if (current->journal_info == NULL) { | 816 | if (current->journal_info == NULL) { |
816 | ret = gfs2_trans_begin(sdp, RES_DINODE, 0); | 817 | ret = gfs2_trans_begin(sdp, RES_DINODE, 0); |