Skip to content

Commit 689fe57

Browse files
author
Jaegeuk Kim
committed
f2fs: allow direct read for zoned device
This reverts dbf8e63 ("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: dbf8e63 ("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>
1 parent 95fa90c commit 689fe57

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/f2fs/f2fs.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4526,7 +4526,12 @@ static inline bool f2fs_force_buffered_io(struct inode *inode,
45264526
/* disallow direct IO if any of devices has unaligned blksize */
45274527
if (f2fs_is_multi_device(sbi) && !sbi->aligned_blksize)
45284528
return true;
4529-
4529+
/*
4530+
* for blkzoned device, fallback direct IO to buffered IO, so
4531+
* all IOs can be serialized by log-structured write.
4532+
*/
4533+
if (f2fs_sb_has_blkzoned(sbi) && (rw == WRITE))
4534+
return true;
45304535
if (f2fs_lfs_mode(sbi) && (rw == WRITE)) {
45314536
if (block_unaligned_IO(inode, iocb, iter))
45324537
return true;

0 commit comments

Comments
 (0)