* [Cluster-devel] [PATCH 00/11] Push file_update_time() into .page_mkwrite
@ 2012-02-16 13:46 Jan Kara
2012-02-16 13:46 ` [Cluster-devel] [PATCH 08/11] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2012-02-16 13:46 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hello,
to provide reliable support for filesystem freezing, filesystems need to have
complete control over when metadata is changed. In particular,
file_update_time() calls from page fault code make it impossible for
filesystems to prevent inodes from being dirtied while the filesystem is
frozen.
To fix the issue, this patch set changes page fault code to call
file_update_time() only when ->page_mkwrite() callback is not provided. If the
callback is provided, it is the responsibility of the filesystem to perform
update of i_mtime / i_ctime if needed. We also push file_update_time() call
to all existing ->page_mkwrite() implementations if the time update does not
obviously happen by other means. If you know your filesystem does not need
update of modification times in ->page_mkwrite() handler, please speak up and
I'll drop the patch for your filesystem.
As a side note, an alternative would be to remove call of file_update_time()
from page fault code altogether and require all filesystems needing it to do
that in their ->page_mkwrite() implementation. That is certainly possible
although maybe slightly inefficient and would require auditting 100+
vm_operations_structs *shake*.
If I get acks on these patches, Andrew, would you be willing to take these
patches?
Honza
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
CC: Ingo Molnar <mingo@elte.hu>
CC: Paul Mackerras <paulus@samba.org>
CC: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
CC: Jaya Kumar <jayalk@intworks.biz>
CC: Sage Weil <sage@newdream.net>
CC: ceph-devel at vger.kernel.org
CC: Steve French <sfrench@samba.org>
CC: linux-cifs at vger.kernel.org
CC: Eric Van Hensbergen <ericvh@gmail.com>
CC: Ron Minnich <rminnich@sandia.gov>
CC: Latchesar Ionkov <lucho@ionkov.net>
CC: v9fs-developer at lists.sourceforge.net
CC: Miklos Szeredi <miklos@szeredi.hu>
CC: fuse-devel at lists.sourceforge.net
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel at redhat.com
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Trond Myklebust <Trond.Myklebust@netapp.com>
CC: linux-nfs at vger.kernel.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH 08/11] gfs2: Push file_update_time() into gfs2_page_mkwrite()
2012-02-16 13:46 [Cluster-devel] [PATCH 00/11] Push file_update_time() into .page_mkwrite Jan Kara
@ 2012-02-16 13:46 ` Jan Kara
2012-02-16 16:47 ` Steven Whitehouse
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2012-02-16 13:46 UTC (permalink / raw)
To: cluster-devel.redhat.com
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel at redhat.com
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/gfs2/file.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index c5fb359..1f03531 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -375,6 +375,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
*/
vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE);
+ /* Update file times before taking page lock */
+ file_update_time(vma->vm_file);
+
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
ret = gfs2_glock_nq(&gh);
if (ret)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH 08/11] gfs2: Push file_update_time() into gfs2_page_mkwrite()
2012-02-16 13:46 ` [Cluster-devel] [PATCH 08/11] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
@ 2012-02-16 16:47 ` Steven Whitehouse
0 siblings, 0 replies; 3+ messages in thread
From: Steven Whitehouse @ 2012-02-16 16:47 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
On Thu, 2012-02-16 at 14:46 +0100, Jan Kara wrote:
> CC: Steven Whitehouse <swhiteho@redhat.com>
> CC: cluster-devel at redhat.com
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> fs/gfs2/file.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
That looks ok to me...
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Steve.
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index c5fb359..1f03531 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -375,6 +375,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
> */
> vfs_check_frozen(inode->i_sb, SB_FREEZE_WRITE);
>
> + /* Update file times before taking page lock */
> + file_update_time(vma->vm_file);
> +
> gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
> ret = gfs2_glock_nq(&gh);
> if (ret)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-16 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-16 13:46 [Cluster-devel] [PATCH 00/11] Push file_update_time() into .page_mkwrite Jan Kara
2012-02-16 13:46 ` [Cluster-devel] [PATCH 08/11] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
2012-02-16 16:47 ` Steven Whitehouse
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).