Re: NOT !! 2.3.99-pre9-5 fixed deadlockswith ReiserFS (possible fix to reiserfs)

From: Matt Yourst (yourst@mit.edu)
Date: Wed May 24 2000 - 21:34:32 EST


David Ford wrote:
>
> Do you want to make avail the patched patch? :)
> Chris Mason wrote:
>
> > > The -pre9 + reiserfs 3.6.5 combo is still definitely *DANGEROUS*.
> >
> > 3.6.5 needed minor patching to work under 2.3.99-pre9-4 and higher. You
> > need to fix the readpage/writepage, and remove all the d_delete calls from
> > fs/reiserfs/namei.c

I tried to apply these changes manually and it appears to fix the problem (i.e.,
cron no longer hangs on startup, other programs don't deadlock with mmap-related
things, etc.) I found a *nasty* bug in the parameters to writepage(): the method
signature changed after pre7-3 such that block_write_full_page was unknowingly
being passed a struct dentry instead of a struct page! Maybe this was the bug
Chris was referring to, as it could very well have been responsible for the data
corruption problem reported earlier.

Here are the patches that appear to fix this:

--- fs/reiserfs/inode.c.orig Wed May 24 21:52:05 2000
+++ fs/reiserfs/inode.c Wed May 24 21:50:19 2000
@@ -1174,13 +1174,12 @@
 }
 
 
-static int reiserfs_readpage (struct dentry * dentry, struct page * page)
+static int reiserfs_readpage (struct file * file, struct page * page)
 {
     return block_read_full_page (page, reiserfs_get_block);
 }
 
-static int reiserfs_writepage (struct file *f, struct dentry * dentry,
- struct page * page)
+static int reiserfs_writepage (struct file * file, struct page * page)
 {
     return block_write_full_page (page, reiserfs_get_block);
 }

--- namei-old.c Wed May 24 22:20:34 2000
+++ namei.c Wed May 24 22:20:57 2000
@@ -664,7 +664,6 @@

     pop_journal_writer(windex) ;
     journal_end(&th, dir->i_sb, jbegin_count) ;
- d_delete(dentry); /* note, must be after journal end */
     reiserfs_check_path(&path) ;
     return 0;

@@ -729,7 +728,6 @@
     pop_journal_writer(windex) ;
     journal_end(&th, dir->i_sb, jbegin_count) ;
     reiserfs_check_path(&path) ;
- d_delete(dentry);
     return 0;

  end_unlink:

Good luck with this; hopefully these were the changes Chris had intended.

- Matt Yourst
 
-------------------------------------------------------------
 Matt T. Yourst Massachusetts Institute of Technology
 yourst@mit.edu 617.225.7690
 513 French House - 476 Memorial Drive - Cambridge, MA 02136
-------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:13 EST