Whamcloud - gitweb
Create the resize inode is created even if the s_reserved_gdt_blocks is
authorTheodore Ts'o <tytso@mit.edu>
Thu, 27 Jan 2005 23:47:51 +0000 (18:47 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Jan 2005 23:47:51 +0000 (18:47 -0500)
zero; e2fsck will now complain and recreate the resize inode if i_links_count
is zero or if it is not a regular file.

e2fsck/ChangeLog
e2fsck/super.c
lib/ext2fs/ChangeLog
lib/ext2fs/res_gdt.c

index c10fa86..c3c98f5 100644 (file)
@@ -1,5 +1,9 @@
 2005-01-27  Theodore Ts'o  <tytso@mit.edu>
 
+       * super.c (check_resize_inode): If the resize inode has a zero
+               i_links_count or isn't a regular file, consider the resize
+               inode as invalid, and offer to recreate it.
+
        * pass2.c (e2fsck_process_bad_inode): Offer to clear i_file_acl
                before checking to see if an invalid inode should be
                removed, since otherwise the fast symlink detection code
index f508c4e..e48a030 100644 (file)
@@ -372,7 +372,8 @@ void check_resize_inode(e2fsck_t ctx)
                if (i != EXT2_DIND_BLOCK && inode.i_block[i])
                        break;
        }
-       if ((i < EXT2_N_BLOCKS) || !blk ||
+       if ((i < EXT2_N_BLOCKS) || !blk || !inode.i_links_count ||
+           !(inode.i_mode & LINUX_S_IFREG) ||
            (blk < fs->super->s_first_data_block ||
             blk >= fs->super->s_blocks_count)) {
        resize_inode_invalid:
index c7c8d01..ce986aa 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-27  Theodore Ts'o  <tytso@mit.edu>
+
+       * res_gdt.c (ext2fs_create_resize_inode): Create the resize inode
+               even if s_reserved_gdt_blocks is zero.
+
 2005-01-26  Theodore Ts'o  <tytso@mit.edu>
 
        * ext2fs.pc.in: Add pkg-config files.
index 1fdb1d4..8b4ddca 100644 (file)
@@ -72,8 +72,6 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
        EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
 
        sb = fs->super;
-       if (!sb->s_reserved_gdt_blocks)
-               return 0;
 
        retval = ext2fs_get_mem(2 * fs->blocksize, (void **)&dindir_buf);
        if (retval)