diff options
| author | Dmitry Monakhov <dmonakhov@openvz.org> | 2014-12-02 16:09:50 -0500 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2014-12-02 16:09:50 -0500 |
| commit | 5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175 (patch) | |
| tree | a2c58f9c69d275ab8a6794c89ccb64232d5634fb | |
| parent | d4f761074353b9aa42a3bdd039d78e1af5f5f29f (diff) | |
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>
| -rw-r--r-- | 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 3ea62695abce..efdcede40c22 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
| @@ -870,6 +870,12 @@ retry_journal: | |||
| 870 | goto out_journal; | 870 | goto out_journal; |
| 871 | } | 871 | } |
| 872 | 872 | ||
| 873 | /* | ||
| 874 | * We cannot recurse into the filesystem as the transaction | ||
| 875 | * is already started. | ||
| 876 | */ | ||
| 877 | flags |= AOP_FLAG_NOFS; | ||
| 878 | |||
| 873 | if (ret == -ENOSPC) { | 879 | if (ret == -ENOSPC) { |
| 874 | ret = ext4_da_convert_inline_data_to_extent(mapping, | 880 | ret = ext4_da_convert_inline_data_to_extent(mapping, |
| 875 | inode, | 881 | inode, |
| @@ -882,11 +888,6 @@ retry_journal: | |||
| 882 | goto out; | 888 | goto out; |
| 883 | } | 889 | } |
| 884 | 890 | ||
| 885 | /* | ||
| 886 | * We cannot recurse into the filesystem as the transaction | ||
| 887 | * is already started. | ||
| 888 | */ | ||
| 889 | flags |= AOP_FLAG_NOFS; | ||
| 890 | 891 | ||
| 891 | page = grab_cache_page_write_begin(mapping, 0, flags); | 892 | page = grab_cache_page_write_begin(mapping, 0, flags); |
| 892 | if (!page) { | 893 | if (!page) { |
