From 5792765939156bd6560220c3d8bde06840ffd1ec Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 10 Aug 2007 14:17:04 -0700 Subject: ocfs2: Fix bad source start calculation during kernel writes For in-kernel writes ocfs2_get_write_source() should be starting the buffer at a page boundary as the math in ocfs2_map_and_write_user_data() will pad it back out to the correct write offset. Instead, we were passing the raw offset, which caused ocfs2_map_and_write_user_data() start too far into the buffer, resulting in corruptions from nfs client writes. Signed-off-by: Mark Fasheh --- fs/ocfs2/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ac6c964..e0cd750 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1353,7 +1353,7 @@ static struct page * ocfs2_get_write_source(struct ocfs2_buffered_write_priv *bp else src_page = ERR_PTR(-EFAULT); } else { - bp->b_src_buf = buf; + bp->b_src_buf = (char *)((unsigned long)buf & PAGE_CACHE_MASK); } return src_page; -- 1.5.0.6