Re: htree 2.4.19-dxdir patch

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

 



On Sep 25, 2002  15:44 -0400, Theodore Ts'o wrote:
> On Tue, Sep 24, 2002 at 09:07:03PM +0200, Jure Pecar wrote:
> > Can you #define 'quite safe' ? :)
> > 
> > Like, is there a possibility of corrupting existing data? Is it production
> > ready?
> > >From all the new filesystems that came out recently i only really trust ext3
> > ... but i really need some form of indexing (large mail spools, maildir).
> 
> I've done a lot of testing on it, and so I believe it's ready for 2.5,
> and will be running it on my laptop.  (This last says a lot; I didn't
> trust 2.4 for a very long time on my laptop....)
> 
> That being said, I'd probably give it a bit more shakedown testing
> before I could in good conscience recommend it on a production mail
> server.  But that's my natural conservatism; other people are more
> adventurous.

One known problem - don't use it with NFS on top - it will overflow the
stack in do_split (it may even overflow without NFS, but in the presence
of interrupts or something).  A sub-optimal fix is below (the "optimal"
fix is not yet working, but avoids the allocation and the potential
panic ;-).  The diff is only approximately a real diff, but you can get
the general idea (it may even apply, I don't know).

Cheers, Andreas
=======================================================================
--- linux/fs/ext3/namei.c.orig	25 Jul 2002 21:35:21 -0000	1.10
+++ linux/fs/ext3/namei.c	23 Sep 2002 23:44:13 -0000	1.12
@@ -778,7 +778,7 @@
 	u32 newblock;
 	unsigned MAX_DX_MAP = PAGE_CACHE_SIZE/EXT3_DIR_REC_LEN(1) + 1;
 	u32 hash2;
-	struct dx_map_entry map[MAX_DX_MAP];
+	struct dx_map_entry *map;
 	char *data1 = (*bh)->b_data, *data2, *data3;
 	unsigned split;
 	ext3_dirent *de, *de2;
@@ -798,6 +798,9 @@
 
 	data2 = bh2->b_data;
 
+	map = kmalloc(sizeof(*map) * MAX_DX_MAP, GFP_KERNEL);
+	if (!map)
+		panic("no memory for do_split\n");
 	count = dx_make_map ((ext3_dirent *) data1, blocksize, map);
 	split = count/2; // need to adjust to actual middle
 	dx_sort_map (map, count);
@@ -828,6 +831,7 @@
 	brelse (bh2);
 	ext3_journal_dirty_metadata (handle, frame->bh);
 	dxtrace(dx_show_index ("frame", frame->entries));
+	kfree(map);
 	return de;
 }
 #endif
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/



_______________________________________________

Ext3-users@redhat.com
https://listman.redhat.com/mailman/listinfo/ext3-users

[Index of Archives]         [Linux RAID]     [Kernel Development]     [Red Hat Install]     [Video 4 Linux]     [Postgresql]     [Fedora]     [Gimp]     [Yosemite News]

  Powered by Linux