Commit bfeb4f99 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 45d0b75b 0dda2ddb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ config ZONEFS_FS
	tristate "zonefs filesystem support"
	depends on BLOCK
	depends on BLK_DEV_ZONED
	select FS_IOMAP
	help
	  zonefs is a simple file system which exposes zones of a zoned block
	  device (e.g. host-managed or host-aware SMR disk drives) as files.
+4 −4
Original line number Diff line number Diff line
@@ -601,13 +601,13 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from)
	ssize_t ret;

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

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