Linux-Fsdevel Archive on
 help / color / Atom feed
From: Jan Kara <>
To: <>
Cc: Christoph Hellwig <>,, <>,
	Matthew Bobrowski <>,
	Jan Kara <>
Subject: [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw()
Date: Wed,  9 Oct 2019 22:41:24 +0200
Message-ID: <> (raw)


when doing the ext4 conversion of direct IO code to iomap, we found it very
difficult to handle inode extension with what iomap code currently provides.
Ext4 wants to do inode extension as sync IO (so that the whole duration of
IO is protected by inode->i_rwsem), also we need to truncate blocks beyond
end of file in case of error or short write. Now in ->end_io handler we don't
have the information how long originally the write was (to judge whether we
may have allocated more blocks than we actually used) and in ->write_iter
we don't know whether / how much of the IO actually succeeded in case of AIO.

Thinking about it for some time I think iomap code makes it unnecessarily
complex for the filesystem in case it decides it doesn't want to perform AIO
and wants to fall back to good old synchronous IO. In such case it is much
easier for the filesystem if it just gets normal error return from
iomap_dio_rw() and not just -EIOCBQUEUED.

The first patch in the series adds argument to iomap_dio_rw() to wait for IO
completion (internally iomap_dio_rw() already supports this!) and the second
patch converts XFS waiting for unaligned DIO write to this new API.

What do people think?


             reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 20:41 Jan Kara [this message]
2019-10-09 20:41 ` [PATCH 1/2] iomap: Allow forcing of waiting for running DIO " Jan Kara
2019-10-09 20:41 ` [PATCH 2/2] xfs: Use iomap_dio_rw_wait() Jan Kara
2019-10-09 23:02 ` [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw() Dave Chinner
2019-10-10  7:54   ` Christoph Hellwig
2019-10-10 14:47     ` Darrick J. Wong
2019-10-10 15:09       ` Jan Kara
2019-10-10  9:18   ` Jan Kara

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Fsdevel Archive on

Archives are clonable:
	git clone --mirror linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ \
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone