ext4: Allow GFP_FS allocations in ext4_da_convert_inline_data_to_extent()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 22 Feb 2022 15:10:51 +0000 (10:10 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 8 May 2022 18:28:19 +0000 (14:28 -0400)
Since commit 8bc1379b82b8, 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: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inline.c

index 9c076262770d9cbcf6f9dc64decb0844b9b6616b..93694ceb5a34249e01e05e57b2f1e5cfb9cb8c7e 100644 (file)
@@ -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,
                                                 struct inode *inode,
-                                                unsigned flags,
                                                 void **fsdata)
 {
        int ret = 0, inline_size;
        struct page *page;
 
-       page = grab_cache_page_write_begin(mapping, 0, flags);
+       page = grab_cache_page_write_begin(mapping, 0, 0);
        if (!page)
                return -ENOMEM;
 
@@ -942,7 +941,6 @@ retry_journal:
                ext4_journal_stop(handle);
                ret = ext4_da_convert_inline_data_to_extent(mapping,
                                                            inode,
-                                                           flags,
                                                            fsdata);
                if (ret == -ENOSPC &&
                    ext4_should_retry_alloc(inode->i_sb, &retries))