* [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock
@ 2016-09-26 17:54 Andreas Gruenbacher
2016-09-26 17:54 ` [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes Andreas Gruenbacher
2016-09-26 18:41 ` [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Bob Peterson
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Gruenbacher @ 2016-09-26 17:54 UTC (permalink / raw)
To: cluster-devel.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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes
2016-09-26 17:54 [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Andreas Gruenbacher
@ 2016-09-26 17:54 ` Andreas Gruenbacher
2016-09-26 18:42 ` Bob Peterson
2016-09-26 18:41 ` [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Bob Peterson
1 sibling, 1 reply; 4+ messages in thread
From: Andreas Gruenbacher @ 2016-09-26 17:54 UTC (permalink / raw)
To: cluster-devel.redhat.com
Fix for commit 719ee344: initialize atime of I_NEW inodes to 0 so that
the timestamps read from disk will always be more recent than the
initial timestamp, and the atime in the I_NEW inode will be set correctly.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/inode.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index e4da0ec..fb3a810 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -187,6 +187,10 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
}
gfs2_set_iop(inode);
+
+ inode->i_atime.tv_sec = 0;
+ inode->i_atime.tv_nsec = 0;
+
unlock_new_inode(inode);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock
2016-09-26 17:54 [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Andreas Gruenbacher
2016-09-26 17:54 ` [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes Andreas Gruenbacher
@ 2016-09-26 18:41 ` Bob Peterson
1 sibling, 0 replies; 4+ messages in thread
From: Bob Peterson @ 2016-09-26 18:41 UTC (permalink / raw)
To: cluster-devel.redhat.com
----- Original Message -----
| 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>
| ---
Hi,
Thanks. This is now applied to the for-next branch of the linux-gfs2 tree:
https://git.kernel.org/cgit/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=d7c436cd605eb203ecf64c40f9b18aa610ac0248
Regards,
Bob Peterson
Red Hat File Systems
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes
2016-09-26 17:54 ` [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes Andreas Gruenbacher
@ 2016-09-26 18:42 ` Bob Peterson
0 siblings, 0 replies; 4+ messages in thread
From: Bob Peterson @ 2016-09-26 18:42 UTC (permalink / raw)
To: cluster-devel.redhat.com
----- Original Message -----
| Fix for commit 719ee344: initialize atime of I_NEW inodes to 0 so that
| the timestamps read from disk will always be more recent than the
| initial timestamp, and the atime in the I_NEW inode will be set correctly.
|
| Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
| ---
Hi,
Thanks. This is now applied to the for-next branch of the linux-gfs2 tree:
https://git.kernel.org/cgit/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=332f51d7db13ffb7fcbe2407ed5b3667bc3750a7
Regards,
Bob Peterson
Red Hat File Systems
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-26 18:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 17:54 [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Andreas Gruenbacher
2016-09-26 17:54 ` [Cluster-devel] [PATCH 2/2] gfs2: Initialize atime of I_NEW inodes Andreas Gruenbacher
2016-09-26 18:42 ` Bob Peterson
2016-09-26 18:41 ` [Cluster-devel] [PATCH 1/2] gfs2: Update file times after grabbing glock Bob Peterson
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).