Re: EXT3 and umount hangs

From: Andreas Dilger (adilger@turbolabs.com)
Date: Tue May 30 2000 - 10:51:44 EST


Tugrul writes:
> I've been using ext3 happily on a bunch of machines (primarily 0.0.2c
> on 2.2.13), and its been really stable. But today I tried installing it on a
> 20GB WD205AA, and it appears that any attempt to umount some of the ext3 file
> systems after one reboot after installing ext3 hangs. The thing that these
> problematic file systems have in common are that they are not the first
> partition in an extended partition. (There are other similarities, like they
> all extend/exist beyond 512 cylinders, but I have other machines where that
> doesn't seem to affect anything.)

I would first suggest applying the 0.0.2c-to-0.0.2d.diff patch included in
the ext3-0.0.2d file from Stephen's site, as it fixes a number of problems.

If that doesn't work, I have a patch that should fix the problem. The
issue is essentially that "sync" does not work properly for ext3, and as
a result the filesystem is unmounted with dirty data, and the kjournald
thread is not shut down properly, causing an oops. Stephen and I have
been testing the patch, and it will likely be in the next ext3 release.

This is actually part of a larger patch that I have been working on for
ext3, which additionally fixes "orphan" inodes (inodes that are unlinked
but held open at the time of a crash), socket filetypes, and inode generation
handling per 2.2.14 ext2. The orphan inode problem is the most serious,
as without it you may "lose" inodes/blocks from the filesystem at each
crash, since e2fsck never runs on an ext3 filesystem. This patch is now
available at ftp://ftp.stelias.com/pub/other/ext3-0.0.2d-orphan.diff
for download. It was also posted yesterday to linux-fsdevel with a more
complete description.

If the below patch doesn't fix your problem, then run ext3 with debugging
turned on (echo 5 > /proc/sys/fs/jfs-debug), and send the output from
ksymoops and the relevant part of your /var/log/messages. I assume you
have an oops somewhere in your /var/log/messages?

Further replies should probably go to linux-fsdevel instead of linux-kernel.

Cheers, Andreas
--- cut here ---
diff -ru linux-2.2.14-ext3/fs/ext3/super.c linux-2.2.14-ext3e/fs/ext3/super.c
--- linux-2.2.14-ext3/fs/ext3/super.c Tue May 23 17:46:31 2000
+++ linux-2.2.14-ext3e/fs/ext3/super.c Fri May 26 15:53:16 2000
@@ -868,17 +933,16 @@
 
 void ext3_write_super (struct super_block * sb)
 {
- struct ext3_super_block * es;
-
         if (!(sb->s_flags & MS_RDONLY)) {
                 journal_t *journal;
-
+
                 journal = EXT3_SB(sb)->s_journal;
- es = sb->u.ext3_sb.s_es;
 
- if (journal->j_running_transaction)
+ if (journal->j_running_transaction) {
+ tid_t wait_tid = journal->j_running_transaction->t_tid;
                         log_start_commit(journal, journal->j_running_transaction);
- if (journal->j_committing_transaction)
+ log_wait_commit(journal, wait_tid);
+ } else if (journal->j_committing_transaction)
                         log_wait_commit(journal, journal->j_committing_transaction->t_tid);
         }
         sb->s_dirt = 0;
diff -ru linux-2.2.14-ext3/fs/jfs/journal.c
linux-2.2.14-ext3e/fs/jfs/journal.c
--- linux-2.2.14-ext3/fs/jfs/journal.c Tue May 23 17:46:31 2000
+++ linux-2.2.14-ext3e/fs/jfs/journal.c Tue May 23 15:41:20 2000
@@ -130,6 +130,11 @@
                     time_after_eq(jiffies, transaction->t_expires))
                         journal->j_commit_request = transaction->t_tid;
         }
+
+ if (journal->j_commit_timer_active) {
+ journal->j_commit_timer_active = 0;
+ del_timer(journal->j_commit_timer);
+ }
         
         journal->j_task = NULL;
         wake_up(&journal->j_wait_done_commit);
--- cut here ---

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- 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:24 EST