ext4: Allow GFP_FS allocations in ext4_da_convert_inline_data_to_extent()

Since commit 8bc1379b, the transaction is stopped before calling
ext4_da_convert_inline_data_to_extent(), which means we can do GFP_FS
allocations and recurse into the filesystem.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent df808180
...@@ -848,13 +848,12 @@ ext4_journalled_write_inline_data(struct inode *inode, ...@@ -848,13 +848,12 @@ ext4_journalled_write_inline_data(struct inode *inode,
*/ */
static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping, static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping,
struct inode *inode, struct inode *inode,
unsigned flags,
void **fsdata) void **fsdata)
{ {
int ret = 0, inline_size; int ret = 0, inline_size;
struct page *page; struct page *page;
page = grab_cache_page_write_begin(mapping, 0, flags); page = grab_cache_page_write_begin(mapping, 0, 0);
if (!page) if (!page)
return -ENOMEM; return -ENOMEM;
...@@ -942,7 +941,6 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping, ...@@ -942,7 +941,6 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping,
ext4_journal_stop(handle); ext4_journal_stop(handle);
ret = ext4_da_convert_inline_data_to_extent(mapping, ret = ext4_da_convert_inline_data_to_extent(mapping,
inode, inode,
flags,
fsdata); fsdata);
if (ret == -ENOSPC && if (ret == -ENOSPC &&
ext4_should_retry_alloc(inode->i_sb, &retries)) ext4_should_retry_alloc(inode->i_sb, &retries))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment