From: Theodore Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Akira Fujita <a-fujita@rs.jp.nec.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 3/3] ext4: Fix deadlock when writing in ENOSPC conditions
Date: Wed, 18 Dec 2013 00:45:59 -0500 [thread overview]
Message-ID: <20131218054559.GC19434@thunk.org> (raw)
In-Reply-To: <1386670440-3158-4-git-send-email-jack@suse.cz>
On Tue, Dec 10, 2013 at 11:14:00AM +0100, Jan Kara wrote:
> Akira-san has been reporting rare deadlocks of his machine when running
> xfstests test 269 on ext4 filesystem. The problem turned out to be in
> ext4_da_reserve_metadata() and ext4_da_reserve_space() which called
> ext4_should_retry_alloc() while holding i_data_sem. Since
> ext4_should_retry_alloc() can force a transaction commit, this is a
> lock ordering violation and leads to deadlocks.
>
> Fix the problem by just removing the retry loops. These functions should
> just report ENOSPC to the caller (e.g. ext4_da_write_begin()) and that
> function must take care of retrying after dropping all necessary locks.
>
> Reported-and-tested-by: Akira Fujita <a-fujita@rs.jp.nec.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
Thanks, applied.
- Ted
prev parent reply other threads:[~2013-12-18 5:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 10:13 [PATCH 0/3] Fix ext4 deadlock when running xfstests/269 Jan Kara
2013-12-10 10:13 ` [PATCH 1/3] ext4: Retry allocation when inline->extent conversion failed Jan Kara
2013-12-12 6:44 ` Zheng Liu
2013-12-12 9:39 ` Jan Kara
2013-12-12 10:30 ` Zheng Liu
2013-12-18 5:45 ` Theodore Ts'o
2013-12-10 10:13 ` [PATCH 2/3] ext4: Standardize error handling in ext4_da_write_inline_data_begin() Jan Kara
2013-12-18 5:45 ` Theodore Ts'o
2013-12-10 10:14 ` [PATCH 3/3] ext4: Fix deadlock when writing in ENOSPC conditions Jan Kara
2013-12-12 6:51 ` Zheng Liu
2013-12-12 9:41 ` Jan Kara
2013-12-18 5:45 ` Theodore Ts'o [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=20131218054559.GC19434@thunk.org \
--to=tytso@mit.edu \
--cc=a-fujita@rs.jp.nec.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).