* [Cluster-devel] [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite
@ 2012-03-05 14:54 Jan Kara
2012-03-05 14:54 ` [Cluster-devel] [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
[not found] ` <1331497397.4641.87.camel@fourier>
0 siblings, 2 replies; 3+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 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. This is including __block_page_mkwrite() so
filesystems using it are handled. 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 calls 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 *shiver*.
Changes since v1:
* Dropped patches for filesystems which don't need them
* Added some acks
* Improved sysfs patch by Alex Elder's suggestion
Changes since v2:
* Dropped patches for more filesystems
Andrew, would you be willing to merge these patches via your tree? This seems
to be a final version.
Honza
CC: Jaya Kumar <jayalk@intworks.biz>
CC: Sage Weil <sage@newdream.net>
CC: ceph-devel 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: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel at redhat.com
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite()
2012-03-05 14:54 [Cluster-devel] [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
@ 2012-03-05 14:54 ` Jan Kara
[not found] ` <1331497397.4641.87.camel@fourier>
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2012-03-05 14:54 UTC (permalink / raw)
To: cluster-devel.redhat.com
CC: Steven Whitehouse <swhiteho@redhat.com>
CC: cluster-devel at redhat.com
Acked-by: Steven Whitehouse <swhiteho@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
[parent not found: <1331497397.4641.87.camel@fourier>]
* [Cluster-devel] [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite
[not found] ` <1331497397.4641.87.camel@fourier>
@ 2012-03-12 8:22 ` Jan Kara
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2012-03-12 8:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Sun 11-03-12 13:23:17, Kamal Mostafa wrote:
> On Mon, 2012-03-05 at 15:54 +0100, Jan Kara wrote:
> > Hello,
> >
> > to provide reliable support for filesystem freezing, filesystems need to have
> > complete control over when metadata is changed. [...]
>
> This patch set has been tested at Canonical along with the testing for
> "[PATCH 00/19] Fix filesystem freezing deadlocks".
>
> Please add the following endorsements for these patches (those actually
> exercised by our test case): 1, 2, 6, 7
>
> Tested-by: Kamal Mostafa <kamal@canonical.com>
> Tested-by: Peter M. Petrakis <peter.petrakis@canonical.com>
> Tested-by: Dann Frazier <dann.frazier@canonical.com>
> Tested-by: Massimo Morana <massimo.morana@canonical.com>
Thanks for testing guys!
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-12 8:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 14:54 [Cluster-devel] [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
2012-03-05 14:54 ` [Cluster-devel] [PATCH 5/7] gfs2: Push file_update_time() into gfs2_page_mkwrite() Jan Kara
[not found] ` <1331497397.4641.87.camel@fourier>
2012-03-12 8:22 ` [Cluster-devel] [PATCH 0/7 v3] Push file_update_time() into .page_mkwrite Jan Kara
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).