--- linux-2.5.6/fs/reiserfs/inode.c.orig Tue Mar 12 15:27:48 2002
+++ linux-2.5.6/fs/reiserfs/inode.c Tue Mar 12 15:28:47 2002
@@ -770,6 +770,11 @@
goto research ;
}
retval = direct2indirect (&th, inode, &path, unbh, tail_offset);
+ if (retval) {
+ reiserfs_unmap_buffer(unbh);
+ reiserfs_free_block (&th, allocated_block_nr);
+ goto failure;
+ }
/* it is important the mark_buffer_uptodate is done after
** the direct2indirect. The buffer might contain valid
** data newer than the data on disk (read by readpage, changed,
@@ -779,10 +784,7 @@
** the disk
*/
mark_buffer_uptodate (unbh, 1);
- if (retval) {
- reiserfs_free_block (&th, allocated_block_nr);
- goto failure;
- }
+
/* we've converted the tail, so we must
** flush unbh before the transaction commits
*/
--- linux-2.5.6/fs/reiserfs/tail_conversion.c.orig Thu Feb 14 16:15:24 2002
+++ linux-2.5.6/fs/reiserfs/tail_conversion.c Thu Feb 14 16:18:24 2002
@@ -49,9 +49,13 @@
make_cpu_key (&end_key, inode, tail_offset, TYPE_INDIRECT, 4);
// FIXME: we could avoid this
- if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND )
- reiserfs_panic (sb, "PAP-14030: direct2indirect: "
- "pasted or inserted byte exists in the tree");
+ if ( search_for_position_by_key (sb, &end_key, path) == POSITION_FOUND ) {
+ reiserfs_warning ("PAP-14030: direct2indirect: "
+ "pasted or inserted byte exists in the tree %K. "
+ "Use fsck to repair.\n", &end_key);
+ pathrelse(path);
+ return -EIO;
+ }