Skip to content

Commit

Permalink
gfs2: Update file times after grabbing glock
Browse files Browse the repository at this point in the history
In gfs2_page_mkwrite, grab the inode glock in EX mode before calling
file_update_time: grabbing the lock may result in a call to
gfs2_dinode_in, which will reset the file times to their on-disk state.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
  • Loading branch information
Andreas Gruenbacher authored and Bob Peterson committed Sep 26, 2016
1 parent e0d735c commit d7c436c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/gfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)

sb_start_pagefault(inode->i_sb);

/* Update file times before taking page lock */
file_update_time(vma->vm_file);

ret = gfs2_rsqa_alloc(ip);
if (ret)
goto out;
Expand All @@ -409,6 +406,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
if (ret)
goto out_uninit;

/* Update file times before taking page lock */
file_update_time(vma->vm_file);

set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
set_bit(GIF_SW_PAGED, &ip->i_flags);

Expand Down

0 comments on commit d7c436c

Please sign in to comment.