From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] ocfs2: Should move ocfs2_start_trans out of lock_page
Date: Wed, 19 Jun 2013 16:17:35 +0800 [thread overview]
Message-ID: <51C1691F.8060504@huawei.com> (raw)
Currently ocfs2_start_trans/ocfs2_commit_trans are in
lock_page/unlock_page. This may cause dead lock.
Here is the situation:
write -> lock_page -> ocfs2_start_trans -> ocfs2_commit_trans -> unlock_page
ocfs2_start_trans/ocfs2_commit_trans calls
jbd2_journal_start/jbd2_journal_stop which may also call lock_page. So
if the page operated is unfortunately the same with the page to be
committed, dead lock happens.
In ext4, lock_page/unlock_page are in
ext4_journal_start/ext4_journal_stop, this can avoid such kind of dead
lock. So I think we should move ocfs2_start_trans/ocfs2_commit_trans out
of lock_page/unlock_page.
Totally there are 5 related functions:
ocfs2_write_begin_nolock
ocfs2_write_begin_inline
ocfs2_write_end_nolock
ocfs2_write_zero_page
ocfs2_convert_inline_data_to_extents
next reply other threads:[~2013-06-19 8:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 8:17 Joseph Qi [this message]
2013-06-24 8:55 ` [Ocfs2-devel] ocfs2: Should move ocfs2_start_trans out of lock_page Joseph Qi
2013-06-29 13:17 ` Joel Becker
2013-06-30 3:10 ` Joseph Qi
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=51C1691F.8060504@huawei.com \
--to=joseph.qi@huawei.com \
--cc=ocfs2-devel@oss.oracle.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.