public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [Ext2-devel] Re: ext3 htree brelse problems look to be fixed!
@ 2003-03-05  2:36 Christopher Li
  2003-03-05  6:54 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Li @ 2003-03-05  2:36 UTC (permalink / raw)
  To: 'Daniel Phillips', James H. Cloos Jr., ext2-devel
  Cc: ext3-users, linux-kernel

I post a patch for comment on ext2-devel for the
NFS cookie bug.  Did not get any feedback yet.
As Ted suggested, it set the cookie to -1 on EOF,
even though it is not seek able to there.

I only test it with Stephen's "readdir.c".
Not have chance to run it on a NFS server yet.

Do you have more information about the cache trashing
bug?

Regards,
Chris


===== dir.c 1.5 vs edited =====
--- 1.5/fs/ext3/dir.c	Wed Oct  2 01:24:11 2002
+++ edited/dir.c	Sat Mar  1 23:45:04 2003
@@ -450,8 +450,10 @@
 						   &info->next_hash);
 			if (ret < 0)
 				return ret;
-			if (ret == 0)
+			if (ret == 0) {
+				filp->f_pos = -1;
 				break;
+			}
 			info->curr_node = rb_get_first(&info->root);
 		}
 

> -----Original Message-----
> From: Daniel Phillips [mailto:phillips@arcor.de]
> Sent: Wednesday, March 05, 2003 12:25 AM
> To: James H. Cloos Jr.; ext2-devel@lists.sourceforge.net
> Cc: ext3-users@redhat.com; linux-kernel@vger.kernel.org
> Subject: [Ext2-devel] Re: ext3 htree brelse problems look to be fixed!
> 
> 
> On Wed 05 Mar 03 00:57, James H. Cloos Jr. wrote:
> > I beleive (with this patch) htree is now ready for prime time.
> 
> Good that it's working for you, but it's not quite the last 
> issue.  There is 
> some apparent cache thrashing to track down, and I believe 
> there's still an 
> outstanding NFS issue.  It's getting there, though.
> 
> Regards,
> 
> Daniel
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of 
> TotalView, The debugger 
> for complex code. Debugging C/C++ programs can leave you 
> feeling lost and 
> disoriented. TotalView can help you find your way. Available 
> on major UNIX 
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Ext2-devel mailing list
> Ext2-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ext2-devel
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Ext2-devel] Re: ext3 htree brelse problems look to be fixed!
  2003-03-05  2:36 [Ext2-devel] Re: ext3 htree brelse problems look to be fixed! Christopher Li
@ 2003-03-05  6:54 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2003-03-05  6:54 UTC (permalink / raw)
  To: Christopher Li
  Cc: 'Daniel Phillips', James H. Cloos Jr., ext2-devel,
	ext3-users, linux-kernel

On Tue, Mar 04, 2003 at 06:36:54PM -0800, Christopher Li wrote:
> I post a patch for comment on ext2-devel for the
> NFS cookie bug.  Did not get any feedback yet.
> As Ted suggested, it set the cookie to -1 on EOF,
> even though it is not seek able to there.

The patch was almost good enough.  The problem with your simple
version was that on the subsequent call to ext3_dx_readdir, the -1 got
translated to a hash value of fffffffe, and if you were unlucky enough
to have a file whose hash was 0xfffffffe, you'd still end up looping
forever.

See the patch which I just sent to ext2-devel and LKML, which I think
solves both this problem and the conversion-to-htree-while-doing-NFS-readdir 
problem.   What I did was to treated f_pos==-1 as an explicit EOF cookie, 
instead of letting it get translated into large hash value.  I also explicitly 
returned a next_hash value of ~0 when there was no more leaf pages, which 
then got immediately translated into a f_pos value of -1.  This saves an 
extra call to ext3_htree_fill_tree(), a minor optimization.

						- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-05  6:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-05  2:36 [Ext2-devel] Re: ext3 htree brelse problems look to be fixed! Christopher Li
2003-03-05  6:54 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox