[PATCH] mke2fs: Make lost+found always have at least two blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hi,

  attached patch modifies mke2fs to always create lost+found with at least
two directory blocks. I think this could make sence not only for testing
but as a sanity check that 64KB support works for general e2fsprogs if
someone decides to use it...

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
---

From: Andreas Dilger <adilger@xxxxxxx>

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: Jan Kara <jack@xxxxxxx>

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 98a4957..6249cc2 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -534,7 +534,10 @@ static void create_lost_and_found(ext2_f
 	}
 	
 	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) {
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux