Whamcloud - gitweb
ChangeLog, expanddir.c:
authorTheodore Ts'o <tytso@mit.edu>
Mon, 24 Nov 1997 11:44:25 +0000 (11:44 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 24 Nov 1997 11:44:25 +0000 (11:44 +0000)
  expanddir.c (ext2fs_expand_dir): Check to make sure the block bitmap
   is loaded, and return an error if it is not.
  expanddir.c (expand_dir_proc): Only use ext2fs_write_dir_block when
   writing a directory block, not when writing out a fresh indirect
   block.

lib/ext2fs/ChangeLog
lib/ext2fs/expanddir.c

index 0e7adc5..e54ef4e 100644 (file)
@@ -1,3 +1,11 @@
+Thu Nov 20 16:07:38 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * expanddir.c (ext2fs_expand_dir): Check to make sure the block
+               bitmap is loaded, and return an error if it is not.
+               (expand_dir_proc): Only use ext2fs_write_dir_block when
+               writing a directory block, not when writing out a fresh
+               indirect block.
+
 Tue Nov 11 22:46:45 1997  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * Makefile.in, tst_getsize.c: Added new file which is used to test
index 1da5143..fc14ad4 100644 (file)
@@ -53,6 +53,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) {
@@ -60,8 +61,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;
@@ -91,6 +92,9 @@ errcode_t ext2fs_expand_dir(ext2_filsys fs, ino_t dir)
        if (!(fs->flags & EXT2_FLAG_RW))
                return EXT2_ET_RO_FILSYS;
 
+       if (!fs->block_map)
+               return EXT2_ET_NO_BLOCK_BITMAP;
+
        retval = ext2fs_check_directory(fs, dir);
        if (retval)
                return retval;