Subject: Re: [Ext2-devel] Re: problems with ext3 fs, kernels up to 2.6.6-rc2
From: Andreas Dilger <[email-masked]>
To: Linux Kernel Mailing List <[email-masked]>, Andrew Morton <[email-masked]>, [email-masked]
Date: Thu, 20 May 2004 03:22:45 -0600

On May 20, 2004  10:40 +0400, Paul P Komkoff Jr wrote:
> Replying to Andreas Dilger:
> > This seems to fix the majority of the problems, although there are still
> > some rare failures in the rename test.
> 
> Just curious. Is it really doing what it should? Is there are cases
> where ext3_delete_entry(handle, old_dir, old_de, old_bh) will be
> called twice with the same set of parameters? :()

Grr, my bad.  I had moved this by hand from 2.4 (where this was discovered
and where I'm testing) to 2.6.current just to make sure the context and
everything was right for submissions and of course botched it.  The right
patch removes the old call to ext3_delete_entry():

===== fs/ext3/namei.c 1.52 vs edited =====
--- 1.52/fs/ext3/namei.c	Mon May 10 05:25:34 2004
+++ edited/fs/ext3/namei.c	Thu May 20 03:16:43 2004
@@ -2264,8 +2264,9 @@
 	/*
 	 * ok, that's it
 	 */
-	retval = ext3_delete_entry(handle, old_dir, old_de, old_bh);
-	if (retval == -ENOENT) {
+	if (le32_to_cpu(old_de->inode) != old_inode->i_ino ||
+	    (retval = ext3_delete_entry(handle, old_dir,
+					old_de, old_bh)) ==  -ENOENT) {
 		/*
 		 * old_de could have moved out from under us.
 		 */

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/