Skip to content

Commit f5c604e

Browse files
Yongpeng Yanggregkh
authored andcommitted
f2fs: fix incorrect multidevice info in trace_f2fs_map_blocks()
commit eb2ca3c upstream. When f2fs_map_blocks()->f2fs_map_blocks_cached() hits the read extent cache, map->m_multidev_dio is not updated, which leads to incorrect multidevice information being reported by trace_f2fs_map_blocks(). This patch updates map->m_multidev_dio in f2fs_map_blocks_cached() when the read extent cache is hit. Cc: stable@kernel.org Fixes: 0094e98 ("f2fs: factor a f2fs_map_blocks_cached helper") Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 75c1800 commit f5c604e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/f2fs/data.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,8 @@ static bool f2fs_map_blocks_cached(struct inode *inode,
15091509
f2fs_wait_on_block_writeback_range(inode,
15101510
map->m_pblk, map->m_len);
15111511

1512-
if (f2fs_allow_multi_device_dio(sbi, flag)) {
1512+
map->m_multidev_dio = f2fs_allow_multi_device_dio(sbi, flag);
1513+
if (map->m_multidev_dio) {
15131514
int bidx = f2fs_target_device_index(sbi, map->m_pblk);
15141515
struct f2fs_dev_info *dev = &sbi->devs[bidx];
15151516

0 commit comments

Comments
 (0)