ext2: Drop GFP_NOFS use in ext2_get_blocks()
authorJan Kara <jack@suse.cz>
Tue, 9 Jan 2024 11:15:43 +0000 (12:15 +0100)
committerJan Kara <jack@suse.cz>
Tue, 23 Jan 2024 18:21:10 +0000 (19:21 +0100)
ext2_get_blocks() calls sb_issue_zeroout() with GFP_NOFS flag. However
the call is performed under inode->i_rwsem and
EXT2_I(inode)->i_truncate_mutex neither of which is acquired during
direct fs reclaim. So it is safe to change the gfp mask to GFP_KERNEL.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/inode.c

index 5a4272b2c6b0a26770e33aa2a1f59e9ff5f7db6b..f3d570a9302b09a1dd206d369c445b745b290fba 100644 (file)
@@ -754,7 +754,7 @@ static int ext2_get_blocks(struct inode *inode,
                 */
                err = sb_issue_zeroout(inode->i_sb,
                                le32_to_cpu(chain[depth-1].key), count,
-                               GFP_NOFS);
+                               GFP_KERNEL);
                if (err) {
                        mutex_unlock(&ei->truncate_mutex);
                        goto cleanup;