From: Chris Mason <mason@suse.com>

For reiserfs, when block size is less then the page size, make sure to copy
from the correct spot in the page.  Before, it was always copying one file
block starting from offset zero in the page, even when the buffer we wanted
started later.

This leads to corruptions after a crash on ia64 and other times when block
size < page size.


---

 25-akpm/fs/reiserfs/journal.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/reiserfs/journal.c~reiserfs-v3-logging-bug-for-blocksize-page-size fs/reiserfs/journal.c
--- 25/fs/reiserfs/journal.c~reiserfs-v3-logging-bug-for-blocksize-page-size	2004-05-22 18:59:57.478856504 -0700
+++ 25-akpm/fs/reiserfs/journal.c	2004-05-22 18:59:57.483855744 -0700
@@ -3553,7 +3553,8 @@ static int do_journal_end(struct reiserf
       set_buffer_uptodate(tmp_bh);
       page = cn->bh->b_page;
       addr = kmap(page);
-      memcpy(tmp_bh->b_data, addr, cn->bh->b_size) ;
+      memcpy(tmp_bh->b_data, addr + offset_in_page(cn->bh->b_data),
+             cn->bh->b_size);
       kunmap(page);
       mark_buffer_dirty(tmp_bh);
       jindex++ ;

_