Cluster-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2] Fix a minor bug in the previous patch
@ 2009-03-23 12:50 Steven Whitehouse
  0 siblings, 0 replies; only message in thread
From: Steven Whitehouse @ 2009-03-23 12:50 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From 3ee85344be5297095845a3bccc1e9e2780ff1f58 Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <swhiteho@redhat.com>
Date: Thu, 19 Mar 2009 13:15:44 +0000
Subject: [PATCH] [GFS2] Fix a minor bug in the previous patch

The logic requires that we mark the glock dirty in page_mkwrite
otherwise we might not flush correctly in the case that no
allocation was required in the process of dirying the page.
Also we need to set the shared write flag early for the same
reason.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 48ec3d5..3b9e8de 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -355,6 +355,9 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
 	if (ret)
 		goto out;
 
+	set_bit(GLF_DIRTY, &ip->i_gl->gl_flags);
+	set_bit(GIF_SW_PAGED, &ip->i_flags);
+
 	ret = gfs2_write_alloc_required(ip, pos, PAGE_CACHE_SIZE, &alloc_required);
 	if (ret || !alloc_required)
 		goto out_unlock;
@@ -395,8 +398,6 @@ static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct page *page)
 			goto out_unlock_page;
 	}
 	ret = gfs2_allocate_page_backing(page);
-	if (!ret)
-		set_bit(GIF_SW_PAGED, &ip->i_flags);
 
 out_unlock_page:
 	unlock_page(page);
-- 
1.6.0.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-23 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-23 12:50 [Cluster-devel] [GFS2] Fix a minor bug in the previous patch Steven Whitehouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox