summaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2009-03-19 13:15:44 +0000
committerSteven Whitehouse <steve@dolmen.chygwyn.com>2009-03-24 11:21:27 +0000
commit9c538837d844574787c95bd5665f684559fb7065 (patch)
tree6f2889435b03df7bd42f75d0f2577faf20d35775 /fs/gfs2
parent6bac243f0793499782267342eba852a8a6cc7ac4 (diff)
downloadlinux-stable-9c538837d844574787c95bd5665f684559fb7065.tar.gz
linux-stable-9c538837d844574787c95bd5665f684559fb7065.tar.bz2
linux-stable-9c538837d844574787c95bd5665f684559fb7065.zip
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>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/ops_file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index 48ec3d5e29eb..3b9e8de3500b 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);