aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2014-12-02 16:09:50 -0500
committerTheodore Ts'o <tytso@mit.edu>2014-12-02 16:09:50 -0500
commit5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175 (patch)
treea2c58f9c69d275ab8a6794c89ccb64232d5634fb /fs/ext4
parentext4: forbid journal_async_commit in data=ordered mode (diff)
downloadlinux-dev-5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175.tar.xz
linux-dev-5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175.zip
ext4: prevent fsreentrance deadlock for inline_data
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> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inline.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index 3ea62695abce..efdcede40c22 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) {