diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-09-30 15:48:24 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-21 12:37:48 +0200 |
commit | d2451b6e352aae2a3ec9de07b4c3bf4e22f4bdab (patch) | |
tree | a31d0b0a6f23dc507fe7b2d9b6ad6ebe9a9e407b /fs | |
parent | 0922ad64ccefa3e483e84355942b86e13c8fea68 (diff) | |
download | linux-stable-d2451b6e352aae2a3ec9de07b4c3bf4e22f4bdab.tar.gz linux-stable-d2451b6e352aae2a3ec9de07b4c3bf4e22f4bdab.tar.bz2 linux-stable-d2451b6e352aae2a3ec9de07b4c3bf4e22f4bdab.zip |
f2fs: allow direct read for zoned device
commit 689fe57e7ecefd2eeba76c32aa569bb3e1e790d9 upstream.
This reverts dbf8e63f48af ("f2fs: remove device type check for direct IO"),
and apply the below first version, since it contributed out-of-order DIO writes.
For zoned devices, f2fs forbids direct IO and forces buffered IO
to serialize write IOs. However, the constraint does not apply to
read IOs.
Cc: stable@vger.kernel.org
Fixes: dbf8e63f48af ("f2fs: remove device type check for direct IO")
Signed-off-by: Eunhee Rho <eunhee83.rho@samsung.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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/f2fs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index c0b9dc2b7f41..30fdda714e95 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -4513,7 +4513,12 @@ static inline bool f2fs_force_buffered_io(struct inode *inode, /* disallow direct IO if any of devices has unaligned blksize */ if (f2fs_is_multi_device(sbi) && !sbi->aligned_blksize) return true; - + /* + * for blkzoned device, fallback direct IO to buffered IO, so + * all IOs can be serialized by log-structured write. + */ + if (f2fs_sb_has_blkzoned(sbi) && (rw == WRITE)) + return true; if (f2fs_lfs_mode(sbi) && (rw == WRITE)) { if (block_unaligned_IO(inode, iocb, iter)) return true; |