aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2016-09-26 14:20:19 -0400
committerBob Peterson <rpeterso@redhat.com>2016-09-26 14:20:19 -0400
commitd7c436cd605eb203ecf64c40f9b18aa610ac0248 (patch)
tree28bcc71357dbec7e1152322409d0f3c362eab0c3
parente0d735c1cc2749598f2d29f60f9a16658fd96ae9 (diff)
gfs2: Update file times after grabbing glock
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>
-rw-r--r--fs/gfs2/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 320e65e61938..360188f162bd 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -395,9 +395,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
395 395
396 sb_start_pagefault(inode->i_sb); 396 sb_start_pagefault(inode->i_sb);
397 397
398 /* Update file times before taking page lock */
399 file_update_time(vma->vm_file);
400
401 ret = gfs2_rsqa_alloc(ip); 398 ret = gfs2_rsqa_alloc(ip);
402 if (ret) 399 if (ret)
403 goto out; 400 goto out;
@@ -409,6 +406,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
409 if (ret) 406 if (ret)
410 goto out_uninit; 407 goto out_uninit;
411 408
409 /* Update file times before taking page lock */
410 file_update_time(vma->vm_file);
411
412 set_bit(GLF_DIRTY, &ip->i_gl->gl_flags); 412 set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
413 set_bit(GIF_SW_PAGED, &ip->i_flags); 413 set_bit(GIF_SW_PAGED, &ip->i_flags);
414 414