Skip to content

Commit bfeb4f9

Browse files
committed
Merge tag 'zonefs-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs
Pull zonefs fixes from Damien Le Moal: "Two fixes in here: - Revert the initial decision to silently ignore IOCB_NOWAIT for asynchronous direct IOs to sequential zone files. Instead, return an error to the user to signal that the feature is not supported (from Christoph) - A fix to zonefs Kconfig to select FS_IOMAP to avoid build failures if no other file system already selected this option (from Johannes)" * tag 'zonefs-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: select FS_IOMAP zonefs: fix IOCB_NOWAIT handling
2 parents 45d0b75 + 0dda2dd commit bfeb4f9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

fs/zonefs/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config ZONEFS_FS
22
tristate "zonefs filesystem support"
33
depends on BLOCK
44
depends on BLK_DEV_ZONED
5+
select FS_IOMAP
56
help
67
zonefs is a simple file system which exposes zones of a zoned block
78
device (e.g. host-managed or host-aware SMR disk drives) as files.

fs/zonefs/super.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,13 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from)
601601
ssize_t ret;
602602

603603
/*
604-
* For async direct IOs to sequential zone files, ignore IOCB_NOWAIT
604+
* For async direct IOs to sequential zone files, refuse IOCB_NOWAIT
605605
* as this can cause write reordering (e.g. the first aio gets EAGAIN
606606
* on the inode lock but the second goes through but is now unaligned).
607607
*/
608-
if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && !is_sync_kiocb(iocb)
609-
&& (iocb->ki_flags & IOCB_NOWAIT))
610-
iocb->ki_flags &= ~IOCB_NOWAIT;
608+
if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && !is_sync_kiocb(iocb) &&
609+
(iocb->ki_flags & IOCB_NOWAIT))
610+
return -EOPNOTSUPP;
611611

612612
if (iocb->ki_flags & IOCB_NOWAIT) {
613613
if (!inode_trylock(inode))

0 commit comments

Comments
 (0)