From 89270b5531516cf80498ad67809c1f09ce476568 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 24 Nov 1997 11:44:25 +0000 Subject: [PATCH] ChangeLog, expanddir.c: 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 | 8 ++++++++ lib/ext2fs/expanddir.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 0e7adc5..e54ef4e 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,11 @@ +Thu Nov 20 16:07:38 1997 Theodore Ts'o + + * 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 * Makefile.in, tst_getsize.c: Added new file which is used to test diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c index 1da5143..fc14ad4 100644 --- a/lib/ext2fs/expanddir.c +++ b/lib/ext2fs/expanddir.c @@ -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; -- 1.8.3.1