summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2007-08-16 17:16:04 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-08-30 23:01:00 -0700
commit1db5759e2d29c90d99659e132d4a137e20460061 (patch)
treebaea3eeedc5430df04897a1df9a473fe41ca3284
parentf742d992d7aa5b719ab7bde0203462b82d168d60 (diff)
ocfs2: Fix bad source start calculation during kernel writes
[PATCH] 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 <mark.fasheh@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/ocfs2/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index ac6c96431bbc..e0cd75068264 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;