* [Patch 7/13] Many inodes in filesystem.
@ 2007-07-24 11:04 Girish Shilamkar
2007-07-24 14:35 ` Theodore Tso
0 siblings, 1 reply; 2+ messages in thread
From: Girish Shilamkar @ 2007-07-24 11:04 UTC (permalink / raw)
To: Ext4 Mailing List; +Cc: Andreas Dilger, Theodore Tso
Handle filesystems with many hard links that have more than ~700M inodes.
The float variable lacks precision at this scale.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Index: e2fsprogs-1.40.1/lib/ext2fs/icount.c
===================================================================
--- e2fsprogs-1.40.1.orig/lib/ext2fs/icount.c
+++ e2fsprogs-1.40.1/lib/ext2fs/icount.c
@@ -376,6 +376,10 @@ static struct ext2_icount_el *get_icount
range = 0.1;
}
mid = low + ((int) (range * (high-low)));
+ if (mid > high)
+ mid = high;
+ if (mid < low)
+ mid = low;
}
#endif
if (ino == icount->list[mid].ino) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch 7/13] Many inodes in filesystem.
2007-07-24 11:04 [Patch 7/13] Many inodes in filesystem Girish Shilamkar
@ 2007-07-24 14:35 ` Theodore Tso
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2007-07-24 14:35 UTC (permalink / raw)
To: Girish Shilamkar; +Cc: Ext4 Mailing List, Andreas Dilger
On Tue, Jul 24, 2007 at 04:34:59PM +0530, Girish Shilamkar wrote:
> Handle filesystems with many hard links that have more than ~700M inodes.
> The float variable lacks precision at this scale.
This was fixed in e2fsprogs mainline a slightly different way. Just
above it:
range = ((float) (ino - lowval)) /
(highval - lowval);
if (range > 0.9)
range = 0.9;
if (range < 0.1)
range = 0.1;
The problem with just correcting the midpoint calculation as you
proposed in your patch is that you could end up doing a linear search
through the whole array in some really abberrant cases. With this fix
applied in e2fsprogs, the patch below isn't required.
Regards,
- Ted
> Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
> Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
> Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
>
> Index: e2fsprogs-1.40.1/lib/ext2fs/icount.c
> ===================================================================
> --- e2fsprogs-1.40.1.orig/lib/ext2fs/icount.c
> +++ e2fsprogs-1.40.1/lib/ext2fs/icount.c
> @@ -376,6 +376,10 @@ static struct ext2_icount_el *get_icount
> range = 0.1;
> }
> mid = low + ((int) (range * (high-low)));
> + if (mid > high)
> + mid = high;
> + if (mid < low)
> + mid = low;
> }
> #endif
> if (ino == icount->list[mid].ino) {
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-24 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-24 11:04 [Patch 7/13] Many inodes in filesystem Girish Shilamkar
2007-07-24 14:35 ` Theodore Tso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).