aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <[email protected]>2022-09-30 22:48:24 +0000
committerJaegeuk Kim <[email protected]>2022-10-05 22:01:32 +0000
commit689fe57e7ecefd2eeba76c32aa569bb3e1e790d9 (patch)
tree717eb43c877b347de55ce514875e38d3f2955ece
parentf2fs: support recording errors into superblock (diff)
downloadkernel-689fe57e7ecefd2eeba76c32aa569bb3e1e790d9.tar.gz
kernel-689fe57e7ecefd2eeba76c32aa569bb3e1e790d9.zip
f2fs: allow direct read for zoned device
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: [email protected] Fixes: dbf8e63f48af ("f2fs: remove device type check for direct IO") Signed-off-by: Eunhee Rho <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
-rw-r--r--fs/f2fs/f2fs.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index b63b482c35a8..1ebc08be958e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -4526,7 +4526,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;