cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 5/6] gfs2: Update file times after grabbing glock
Date: Mon,  3 Oct 2016 07:57:48 -0500	[thread overview]
Message-ID: <1475499469-9159-6-git-send-email-rpeterso@redhat.com> (raw)
In-Reply-To: <1475499469-9159-1-git-send-email-rpeterso@redhat.com>

From: Andreas Gruenbacher <agruenba@redhat.com>

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>
---
 fs/gfs2/file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 320e65e..360188f 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)
 
 	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;
@@ -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);
 
-- 
2.7.4



  parent reply	other threads:[~2016-10-03 12:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03 12:57 [Cluster-devel] [PATCH 0/6] GFS2: Pre-pull patch posting (merge window) Bob Peterson
2016-10-03 12:57 ` [Cluster-devel] [PATCH 1/6] GFS2: use BIT() macro Bob Peterson
2016-10-03 12:57 ` [Cluster-devel] [PATCH 2/6] gfs2: Remove dirty buffer warning from gfs2_releasepage Bob Peterson
2016-10-03 12:57 ` [Cluster-devel] [PATCH 3/6] gfs2: Fix extended attribute readahead optimization Bob Peterson
2016-10-03 12:57 ` [Cluster-devel] [PATCH 4/6] gfs2: fix to detect failure of register_shrinker Bob Peterson
2016-10-03 12:57 ` Bob Peterson [this message]
2016-10-03 12:57 ` [Cluster-devel] [PATCH 6/6] gfs2: Initialize atime of I_NEW inodes Bob Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1475499469-9159-6-git-send-email-rpeterso@redhat.com \
    --to=rpeterso@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).