Whamcloud - gitweb
ChangeLog, pass3.c:
authorTheodore Ts'o <tytso@mit.edu>
Thu, 20 Nov 1997 21:52:43 +0000 (21:52 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 20 Nov 1997 21:52:43 +0000 (21:52 +0000)
  Fix bug which could cause core dump when expanding the directory, and
  the bitmaps hadn't yet been read in.  Also, only use
  ext2fs_write_dir_block when writing a directory block, not when
  writing out a fresh indirect block.

e2fsck/ChangeLog
e2fsck/pass3.c

index 834eb4e..5370bfb 100644 (file)
@@ -1,3 +1,11 @@
+Thu Nov 20 16:02:23 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * pass3.c (expand_directory): Fix bug which could cause core dump
+               when expanding the directory, and the bitmaps hadn't yet
+               been read in.  Also, only use ext2fs_write_dir_block when
+               writing a directory block, not when writing out a fresh
+               indirect block.
+
 Wed Nov 19 16:15:44 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * pass1.c (process_bad_block): Fix bug where first_block wasn't
index 9af3be7..300d52e 100644 (file)
@@ -635,6 +635,7 @@ static int expand_dir_proc(ext2_filsys fs,
                        return BLOCK_ABORT;
                }
                es->done = 1;
+               retval = ext2fs_write_dir_block(fs, new_blk, block);
        } else {
                retval = ext2fs_get_mem(fs->blocksize, (void **) &block);
                if (retval) {
@@ -642,8 +643,8 @@ static int expand_dir_proc(ext2_filsys fs,
                        return BLOCK_ABORT;
                }
                memset(block, 0, fs->blocksize);
+               retval = io_channel_write_blk(fs->io, new_blk, 1, block);
        }       
-       retval = ext2fs_write_dir_block(fs, new_blk, block);
        if (retval) {
                es->err = retval;
                return BLOCK_ABORT;
@@ -669,6 +670,12 @@ static errcode_t expand_directory(e2fsck_t ctx, ino_t dir)
        if (!(fs->flags & EXT2_FLAG_RW))
                return EXT2_ET_RO_FILSYS;
 
+       /*
+        * Read the inode and block bitmaps in; we'll be messing with
+        * them.
+        */
+       e2fsck_read_bitmaps(ctx);
+       
        retval = ext2fs_check_directory(fs, dir);
        if (retval)
                return retval;