Message ID | 20220822115915.88205-1-hanjinke.666@bytedance.com |
---|---|
State | New |
Headers | show |
Series | [v2] ext4: do io submit when next to write page not continuous | expand |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 601214453c3a..ad7139a835a2 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2608,6 +2608,12 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) if (mpd->map.m_len > 0 && mpd->next_page != page->index) goto out; + /* Submit bio when page no longer continus and + * do it before taking other page's lock. + */ + if (mpd->next_page != page->index && mpd->io_submit.io_bio) + ext4_io_submit(&mpd->io_submit); + lock_page(page); /* * If the page is no longer dirty, or its mapping no