linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 2/4] ext4: prevent fsreentrance deadlock for inline_data
Date: Tue,  2 Dec 2014 15:00:52 +0400	[thread overview]
Message-ID: <1417518054-21733-2-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1417518054-21733-1-git-send-email-dmonakhov@openvz.org>

ext4_da_convert_inline_data_to_extent() invokes grab_cache_page_write_begin().
grab_cache_page_write_begin performs memory allocation, so fs-reentrance
should be prohibited because we are inside journal transaction.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/inline.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 3ea6269..efdcede 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -870,6 +870,12 @@ retry_journal:
 			goto out_journal;
 	}
 
+	/*
+	 * We cannot recurse into the filesystem as the transaction
+	 * is already started.
+	 */
+	flags |= AOP_FLAG_NOFS;
+
 	if (ret == -ENOSPC) {
 		ret = ext4_da_convert_inline_data_to_extent(mapping,
 							    inode,
@@ -882,11 +888,6 @@ retry_journal:
 		goto out;
 	}
 
-	/*
-	 * We cannot recurse into the filesystem as the transaction
-	 * is already started.
-	 */
-	flags |= AOP_FLAG_NOFS;
 
 	page = grab_cache_page_write_begin(mapping, 0, flags);
 	if (!page) {
-- 
1.7.1


  reply	other threads:[~2014-12-02 11:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 11:00 [PATCH 1/4] ext4: fix potential use after free during resize V2 Dmitry Monakhov
2014-12-02 11:00 ` Dmitry Monakhov [this message]
2014-12-02 23:07   ` [PATCH 2/4] ext4: prevent fsreentrance deadlock for inline_data Theodore Ts'o
2014-12-02 11:00 ` [PATCH 3/4] ext4: ext4_inline_data_fiemap should respect callers argument Dmitry Monakhov
2014-12-02 23:07   ` Theodore Ts'o
2014-12-02 11:00 ` [PATCH 4/4] ext4: fix suboptimal seek_{data,hole} extents traversial Dmitry Monakhov
2014-12-02 23:07   ` Theodore Ts'o
2014-12-11 20:05   ` Theodore Ts'o
2014-12-12  8:52     ` Dmitry Monakhov
2014-12-17  3:57       ` Theodore Ts'o
2014-12-17 15:06         ` Dmitry Monakhov
2014-12-18  2:39           ` Theodore Ts'o
2014-12-27 15:39           ` Theodore Ts'o
2014-12-28 18:55             ` Dmitry Monakhov
2014-12-29  4:13               ` Theodore Ts'o
2015-01-02 20:03                 ` Theodore Ts'o
2015-01-03 19:16                   ` Dmitry Monakhov
2014-12-02 11:12 ` [PATCH 1/4] ext4: fix potential use after free during resize V2 Dmitry Monakhov
2014-12-02 23:06 ` Theodore Ts'o

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=1417518054-21733-2-git-send-email-dmonakhov@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).