]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
ChangeLog, pass1.c, pass1b.c:
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 Jun 2001 19:29:36 +0000 (19:29 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 Jun 2001 19:29:36 +0000 (19:29 +0000)
  pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode,
   pass1_check_directory): Add a safety check to make sure
   ctx->stashed_inode is non-zero.
  pass1b.c (pass1b): Use e2fsck_use_inode_shortcuts() to disable the
   inode shortcut processing, instead of manually clearing only half of
   the function pointers that needed to be NULL'ed out.  This caused
   nasty bugs if the last inode in the filesystem needed dup block
   processing.
  pass1b.c (clone_file_block): When cloning a directory's metadata
   block, don't try to update the directory block list database, since
   indirect blocks aren't stored in the database and the resulting error
   will abort the file clone operation.

e2fsck/ChangeLog
e2fsck/pass1.c
e2fsck/pass1b.c

index 270e18deb8d5dc9d33adba028e90691ef672dca7..50e226671c84a834829293551e8e7118b3370f27 100644 (file)
@@ -1,3 +1,21 @@
+2001-06-01  Theodore Tso  <tytso@valinux.com>
+
+       * pass1.c (pass1_get_blocks, pass1_read_inode, pass1_write_inode, 
+               pass1_check_directory): Add a safety check to make sure
+               ctx->stashed_inode is non-zero.
+
+       * pass1b.c (pass1b): Use e2fsck_use_inode_shortcuts() to disable
+               the inode shortcut processing, instead of manually
+               clearing only half of the function pointers that needed to
+               be NULL'ed out.  This caused nasty bugs if the last inode
+               in the filesystem needed dup block processing.
+               
+       * pass1b.c (clone_file_block): When cloning a directory's metadata
+               block, don't try to update the directory block list
+               database, since indirect blocks aren't stored in the
+               database and the resulting error will abort the file clone
+               operation.
+
 2001-05-25  Theodore Tso  <tytso@valinux.com>
 
        * Release of E2fsprogs 1.20
index e0c08b5dd0663514c6b89a9e7f990644517d4ec6..62aa08e2af7f086fd23f002806956c377ca2fddf 100644 (file)
@@ -1522,7 +1522,7 @@ static errcode_t pass1_get_blocks(ext2_filsys fs, ext2_ino_t ino,
        e2fsck_t ctx = (e2fsck_t) fs->priv_data;
        int     i;
        
-       if (ino != ctx->stashed_ino)
+       if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
                return EXT2_ET_CALLBACK_NOTHANDLED;
 
        for (i=0; i < EXT2_N_BLOCKS; i++)
@@ -1535,7 +1535,7 @@ static errcode_t pass1_read_inode(ext2_filsys fs, ext2_ino_t ino,
 {
        e2fsck_t ctx = (e2fsck_t) fs->priv_data;
 
-       if (ino != ctx->stashed_ino)
+       if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
                return EXT2_ET_CALLBACK_NOTHANDLED;
        *inode = *ctx->stashed_inode;
        return 0;
@@ -1546,7 +1546,7 @@ static errcode_t pass1_write_inode(ext2_filsys fs, ext2_ino_t ino,
 {
        e2fsck_t ctx = (e2fsck_t) fs->priv_data;
 
-       if (ino == ctx->stashed_ino)
+       if ((ino == ctx->stashed_ino) && ctx->stashed_inode)
                *ctx->stashed_inode = *inode;
        return EXT2_ET_CALLBACK_NOTHANDLED;
 }
@@ -1555,7 +1555,7 @@ static errcode_t pass1_check_directory(ext2_filsys fs, ext2_ino_t ino)
 {
        e2fsck_t ctx = (e2fsck_t) fs->priv_data;
 
-       if (ino != ctx->stashed_ino)
+       if ((ino != ctx->stashed_ino) || !ctx->stashed_inode)
                return EXT2_ET_CALLBACK_NOTHANDLED;
 
        if (!LINUX_S_ISDIR(ctx->stashed_inode->i_mode))
@@ -1580,5 +1580,3 @@ void e2fsck_use_inode_shortcuts(e2fsck_t ctx, int bool)
                fs->write_inode = 0;
        }
 }
-
-               
index 5aab10905d98c606de2e2b0c7ce8a2f81a780bc8..f300de359afad9313f2946332b906879d1183c14 100644 (file)
@@ -226,8 +226,7 @@ static void pass1b(e2fsck_t ctx, char *block_buf)
                }
        }
        ext2fs_close_inode_scan(scan);
-       fs->get_blocks = 0;
-       fs->check_directory = 0;
+       e2fsck_use_inode_shortcuts(ctx, 0);
 }
 
 static int process_pass1b_block(ext2_filsys fs,
@@ -586,7 +585,7 @@ static int clone_file_block(ext2_filsys fs,
                                cs->errcode = retval;
                                return BLOCK_ABORT;
                        }
-                       if (cs->dir) {
+                       if (cs->dir && (blockcnt >= 0)) {
                                retval = ext2fs_set_dir_block(fs->dblist,
                                      cs->dir, new_block, blockcnt);
                                if (retval) {