diff options
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/file.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 7cfdcb913363..216ad2774a62 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -448,15 +448,20 @@ static int gfs2_mmap(struct file *file, struct vm_area_struct *vma) | |||
448 | { | 448 | { |
449 | struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); | 449 | struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); |
450 | 450 | ||
451 | if (!(file->f_flags & O_NOATIME)) { | 451 | if (!(file->f_flags & O_NOATIME) && |
452 | !IS_NOATIME(&ip->i_inode)) { | ||
452 | struct gfs2_holder i_gh; | 453 | struct gfs2_holder i_gh; |
453 | int error; | 454 | int error; |
454 | 455 | ||
455 | gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh); | 456 | gfs2_holder_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); |
456 | error = gfs2_glock_nq(&i_gh); | 457 | error = gfs2_glock_nq(&i_gh); |
457 | file_accessed(file); | 458 | if (error == 0) { |
458 | if (error == 0) | 459 | file_accessed(file); |
459 | gfs2_glock_dq_uninit(&i_gh); | 460 | gfs2_glock_dq(&i_gh); |
461 | } | ||
462 | gfs2_holder_uninit(&i_gh); | ||
463 | if (error) | ||
464 | return error; | ||
460 | } | 465 | } |
461 | vma->vm_ops = &gfs2_vm_ops; | 466 | vma->vm_ops = &gfs2_vm_ops; |
462 | vma->vm_flags |= VM_CAN_NONLINEAR; | 467 | vma->vm_flags |= VM_CAN_NONLINEAR; |