This is a binary release of e2fsprogs-1.06 for Linux/m68k ELF. The patch I applied first is appended below. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From: Andreas Schwab Date: Thu, 21 Nov 96 10:41:00 +0100 To: tytso@mit.edu Cc: linux-m68k@phil.uni-sb.de Subject: L68K: Bugs in e2fsprogs-1.06/e2fsck Hi! There is a nasty bug in e2fsck that can result in a completely hosed filesystem when trying to byteswap it. When following the indirect block chains in swap_inodes deleted inodes and fast symlinks must be ignored, since they don't have a valid block list. While hunting for this bug i also found another place where the block list of a fast symlink is not properly ignored. Finally another bug is in process_inodes, which must save and restore stashed_ino. Andreas. ---------------------------------------------------------------------- --- e2fsprogs-1.06/e2fsck/pass1.c.~1~ Mon Oct 7 03:38:28 1996 +++ e2fsprogs-1.06/e2fsck/pass1.c Wed Nov 20 11:37:17 1996 @@ -394,8 +394,10 @@ fs_blockdev_count++; else if (LINUX_S_ISLNK (inode.i_mode)) { fs_symlinks_count++; - if (!inode.i_blocks) + if (!inode.i_blocks) { fs_fast_symlinks_count++; + goto next; + } } else if (LINUX_S_ISFIFO (inode.i_mode)) fs_fifo_count++; @@ -488,6 +490,7 @@ { int i; struct ext2_inode *old_stashed_inode; + ino_t old_stashed_ino; ino_t ino; const char *old_operation; char buf[80]; @@ -497,6 +500,7 @@ #endif old_operation = ehandler_operation(0); old_stashed_inode = stashed_inode; + old_stashed_ino = stashed_ino; qsort(inodes_to_process, process_inode_count, sizeof(struct process_inode_block), process_inode_cmp); for (i=0; i < process_inode_count; i++) { @@ -512,6 +516,7 @@ } stashed_inode = old_stashed_inode; + stashed_ino = old_stashed_ino; process_inode_count = 0; #if 0 printf("end process inodes\n"); --- e2fsprogs-1.06/e2fsck/swapfs.c.~1~ Mon Oct 7 06:57:17 1996 +++ e2fsprogs-1.06/e2fsck/swapfs.c Wed Nov 20 11:15:05 1996 @@ -131,10 +131,12 @@ stashed_ino = ino; stashed_inode = inode; - if (inode->i_block[EXT2_IND_BLOCK] || - inode->i_block[EXT2_DIND_BLOCK] || - inode->i_block[EXT2_TIND_BLOCK] || - LINUX_S_ISDIR(inode->i_mode)) + if (inode->i_links_count > 0 && + inode_has_valid_blocks(inode) && + (inode->i_block[EXT2_IND_BLOCK] || + inode->i_block[EXT2_DIND_BLOCK] || + inode->i_block[EXT2_TIND_BLOCK] || + LINUX_S_ISDIR(inode->i_mode))) swap_inode_blocks(fs, ino, block_buf, inode); if (fs->flags & EXT2_FLAG_SWAP_BYTES_WRITE) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Geert Uytterhoeven Geert.Uytterhoeven@cs.kuleuven.ac.be Wavelets, Linux/m68k on Amiga http://www.cs.kuleuven.ac.be/~geert/ Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium