From: alex chen <alex.chen@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH v2] ocfs2: should wait dio before inode lock in ocfs2_setattr()
Date: Thu, 2 Nov 2017 11:03:15 +0800 [thread overview]
Message-ID: <59FA8AF3.9070301@huawei.com> (raw)
In-Reply-To: <20171101134901.3e5c2153b21edbe59185f646@linux-foundation.org>
Hi Andrew Morton,
On 2017/11/2 4:49, Andrew Morton wrote:
> On Tue, 31 Oct 2017 14:20:38 +0800 alex chen <alex.chen@huawei.com> wrote:
>
>> we should wait dio requests to finish before inode lock in
>> ocfs2_setattr(), otherwise the following deadlock will be happened:
>> process 1 process 2 process 3
>> truncate file 'A' end_io of writing file 'A' receiving the bast messages
>> ocfs2_setattr
>> ocfs2_inode_lock_tracker
>> ocfs2_inode_lock_full
>> inode_dio_wait
>> __inode_dio_wait
>> -->waiting for all dio
>> requests finish
>> dlm_proxy_ast_handler
>> dlm_do_local_bast
>> ocfs2_blocking_ast
>> ocfs2_generic_handle_bast
>> set OCFS2_LOCK_BLOCKED flag
>> dio_end_io
>> dio_bio_end_aio
>> dio_complete
>> ocfs2_dio_end_io
>> ocfs2_dio_end_io_write
>> ocfs2_inode_lock
>> __ocfs2_cluster_lock
>> ocfs2_wait_for_mask
>> -->waiting for OCFS2_LOCK_BLOCKED
>> flag to be cleared, that is waiting
>> for 'process 1' unlocking the inode lock
>> inode_dio_end
>> -->here dec the i_dio_count, but will never
>> be called, so a deadlock happened.
>>
>
> This sounds like something which should be backported into -stable
> kernels. Do you agree?
>
Yes, I think this problem also exists in the "-stable" tree.
Thanks,
Alex
>
> .
>
prev parent reply other threads:[~2017-11-02 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 6:20 [Ocfs2-devel] [PATCH v2] ocfs2: should wait dio before inode lock in ocfs2_setattr() alex chen
2017-11-01 20:49 ` Andrew Morton
2017-11-02 3:03 ` alex chen [this message]
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=59FA8AF3.9070301@huawei.com \
--to=alex.chen@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.