ext4: use bdev_getblk() to avoid memory reclaim in readahead path

sb_getblk_gfp adds __GFP_NOFAIL, which is unnecessary for readahead; we're
quite comfortable with the possibility that we may not get a bh back. 
Switch to bdev_getblk() which does not include __GFP_NOFAIL.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reported-by: Hui Zhu <[email protected]>
Closes: https://lore.kernel.org/linux-fsdevel/[email protected]/
Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
Matthew Wilcox (Oracle)
2023-10-04 10:32:28 -07:00
committed by Andrew Morton
parent 3ed65f04aa
commit e509ad4d77
+2 -1
View File
@@ -255,7 +255,8 @@ struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb,
void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block)
{
struct buffer_head *bh = sb_getblk_gfp(sb, block, 0);
struct buffer_head *bh = bdev_getblk(sb->s_bdev, block,
sb->s_blocksize, GFP_NOWAIT);
if (likely(bh)) {
if (trylock_buffer(bh))