On Nov 12, 2007  09:58 -0500, Theodore Tso wrote:
> On Mon, Nov 12, 2007 at 10:52:45AM +0100, Jan Kara wrote:
> > > Did you test this patch before submitting it?
> >
> >   Argh, stupid me. I've just tested that I didn't break anything for normal
> > block size and thought that I cannot make mistake in such a simple thing
> > ;).
> 
> Could I ask you to perhaps include some 64k blocksize test cases that
> would exercise the new codepaths?

One thing I had done to verify that 64kB rec_len was broken was to always
create lost+found with at least 2 disk blocks, since the second block in
lost+found will not have any dirents in it and will tickle this bug.

Patch attached.

Cheers, Andreas
--
Andreas Dilger
Sr. Software Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

Index: e2fsprogs-cfs/misc/mke2fs.c
===================================================================
--- e2fsprogs-cfs.orig/misc/mke2fs.c
+++ e2fsprogs-cfs/misc/mke2fs.c
@@ -551,7 +551,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) {

Reply via email to