Commit 02f03c42 authored by Linus Torvalds's avatar Linus Torvalds

Revert "Revert "ext4: make __ext4_get_inode_loc plug""

This reverts commit 72dbcf72.

Instead of waiting forever for entropy that may just not happen, we now
try to actively generate entropy when required, and are thus hopefully
avoiding the problem that caused the nice ext4 IO pattern fix to be
reverted.

So revert the revert.

Cc: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 50ee7529
...@@ -4586,6 +4586,7 @@ static int __ext4_get_inode_loc(struct inode *inode, ...@@ -4586,6 +4586,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
struct buffer_head *bh; struct buffer_head *bh;
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
ext4_fsblk_t block; ext4_fsblk_t block;
struct blk_plug plug;
int inodes_per_block, inode_offset; int inodes_per_block, inode_offset;
iloc->bh = NULL; iloc->bh = NULL;
...@@ -4674,6 +4675,7 @@ static int __ext4_get_inode_loc(struct inode *inode, ...@@ -4674,6 +4675,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
* If we need to do any I/O, try to pre-readahead extra * If we need to do any I/O, try to pre-readahead extra
* blocks from the inode table. * blocks from the inode table.
*/ */
blk_start_plug(&plug);
if (EXT4_SB(sb)->s_inode_readahead_blks) { if (EXT4_SB(sb)->s_inode_readahead_blks) {
ext4_fsblk_t b, end, table; ext4_fsblk_t b, end, table;
unsigned num; unsigned num;
...@@ -4704,6 +4706,7 @@ static int __ext4_get_inode_loc(struct inode *inode, ...@@ -4704,6 +4706,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
get_bh(bh); get_bh(bh);
bh->b_end_io = end_buffer_read_sync; bh->b_end_io = end_buffer_read_sync;
submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh); submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, bh);
blk_finish_plug(&plug);
wait_on_buffer(bh); wait_on_buffer(bh);
if (!buffer_uptodate(bh)) { if (!buffer_uptodate(bh)) {
EXT4_ERROR_INODE_BLOCK(inode, block, EXT4_ERROR_INODE_BLOCK(inode, block,
......
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