]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ocfs2: Fix bad source start calculation during kernel writes
authorMark Fasheh <mark.fasheh@oracle.com>
Fri, 17 Aug 2007 00:16:04 +0000 (17:16 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 31 Aug 2007 06:01:00 +0000 (23:01 -0700)
[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>
fs/ocfs2/file.c

index ac6c96431bbcb3a7687b522465e456d68246c002..e0cd75068264dd017cfdaa9916cc5b502f019a01 100644 (file)
@@ -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;