Skip to content

Commit

Permalink
Fix a minor bug in the previous patch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Whitehouse authored and Steven Whitehouse committed Mar 24, 2009
1 parent 6bac243 commit 9c53883
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/gfs2/ops_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9c53883

Please sign in to comment.