Theodore Ts'o wrote: > On Wed, Jan 26, 2005 at 11:22:39PM -0800, pmeda@akamai.com wrote: > > > > Apply ext3 speedups added by Jan Kara to ext2. > > Reference: http://linus.bkbits.net:8080/linux-2.5/gnupatch@41f127f2jwYahmKm0eWTJNpYcSyhPw > > > > This patch isn't right, as it causes ext2_sparse_group(1) to return 0 > instead of 1. Block groups number 0 and 1 must always contain a > superblock. > > > static int ext2_group_sparse(int group) > > { > > + if (group <= 0) > > + return 1; > > Change this to be: > > + if (group <= 1) > + return 1; > > and it should fix the patch (as well as be similar to the ext3 > mainline). With this change, > > Acked-by: "Theodore Ts'o" Thanks for correction! I made one more attempt to improve it. Please look at the attached patch. - Folded all three root checkings for 3, 5 and 7 into one loop. - Short cut the loop with 3**n < 5 **n < 7**n logic. - Even numbers can be ruled out. Tested with user space programs. Thanks, Prasanna.