From: Mark Fasheh <mark.fasheh@oracle.com>
To: marcelo@conectiva.com.br
Cc: sct@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH] Fix deadlock in journal_create
Date: Fri, 30 May 2003 14:31:39 -0700 [thread overview]
Message-ID: <20030530213139.GD965@ca-server1.us.oracle.com> (raw)
Hi,
I ran across a deadlock yesterday when trying to do a journal_create
at mount time. The problem is that journal_create does a sync_dev which
eventually tries to do a get_super which does:
down_read(&s->s_umount);
The problem arises if I call journal_create from my read_super method in
which case get_sb_bdev has already done:
down_write(&s->s_umount);
from alloc_super. Replacing the sync_dev call with an fsync_no_super seems
to have fixed the deadlock.
It you want to test this out using ext3 (I have verified it with my own
filesystem), simply follow these steps:
1) create an ext2 filesystem on a device
2) mount that new partition and make a "journal file" on it (using dd).
get the inode number of that file.
3) unmount it and remount it as an ext3 filesystem using the option:
journal=inode_number where inode number is the inode number of the journal
file you just created.
This will get ext3's read_super method to call ext3_create_journal which
will hang during a journal_create.
A one line patch is attached. Please let me know what you think.
--Mark
--
Mark Fasheh
Software Developer, Oracle Corp
mark.fasheh@oracle.com
--- linux-2.4.21-rc6/fs/jbd/journal.c.orig 2003-05-30 11:49:10.000000000 -0700
+++ linux-2.4.21-rc6/fs/jbd/journal.c 2003-05-30 11:49:18.000000000 -0700
@@ -912,7 +912,7 @@ int journal_create(journal_t *journal)
__brelse(bh);
}
- sync_dev(journal->j_dev);
+ fsync_no_super(journal->j_dev);
jbd_debug(1, "JBD: journal cleared.\n");
/* OK, fill in the initial static fields in the new superblock */
next reply other threads:[~2003-05-30 21:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-30 21:31 Mark Fasheh [this message]
2003-06-02 14:08 ` [PATCH] Fix deadlock in journal_create Stephen C. Tweedie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030530213139.GD965@ca-server1.us.oracle.com \
--to=mark.fasheh@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=sct@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.