Skip to content

Commit

Permalink
ocfs2: return 0 in page_mkwrite to let VFS retry.
Browse files Browse the repository at this point in the history
In ocfs2_page_mkwrite, we return -EINVAL when we found the page mapping
isn't updated, and it will cause the user space program get SIGBUS and
exit. The reason is that during race writeable mmap, we will do
unmap_mapping_range in ocfs2_data_downconvert_worker. The good thing is
that if we reuturn 0 in page_mkwrite, VFS will retry fault and then
call page_mkwrite again, so it is safe to return 0 here.

Signed-off-by: Tao Ma <[email protected]>
Signed-off-by: Mark Fasheh <[email protected]>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Nov 10, 2008
1 parent ae0dff6 commit 4c1bbf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/ocfs2/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
* ocfs2_write_begin_nolock().
*/
if (!PageUptodate(page) || page->mapping != inode->i_mapping) {
ret = -EINVAL;
/*
* the page has been umapped in ocfs2_data_downconvert_worker.
* So return 0 here and let VFS retry.
*/
ret = 0;
goto out;
}

Expand Down

0 comments on commit 4c1bbf1

Please sign in to comment.