]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
mke2fs: Make lost+found always have at least 2 blocks
authorAndreas Dilger <adilger@sun.com>
Wed, 9 Jan 2008 19:59:47 +0000 (20:59 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jan 2008 15:49:18 +0000 (10:49 -0500)
Make sure lost+found has always at least 2 disk blocks. This will provide at
least elementary test that we have not screwed-up support for 64KB blocks since
the second directory block will be empty.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/mke2fs.c

index 44f45aa5f6933bb1d4927742f8d3273c37620a1f..b0cbc42d4c5c53c6e4ffaa50d5313d328d43085b 100644 (file)
@@ -534,7 +534,10 @@ static void create_lost_and_found(ext2_filsys fs)
        }
        
        for (i=1; i < EXT2_NDIR_BLOCKS; i++) {
-               if ((lpf_size += fs->blocksize) >= 16*1024)
+               /* Ensure that lost+found is at least 2 blocks, so we always
+                * test large empty blocks for big-block filesystems.  */
+               if ((lpf_size += fs->blocksize) >= 16*1024 &&
+                   lpf_size >= 2 * fs->blocksize)
                        break;
                retval = ext2fs_expand_dir(fs, ino);
                if (retval) {