From: Jeff Moyer <jmoyer@redhat.com>
To: linux-ext4@vger.kernel.org, xfs@oss.sgi.com,
linux-fsdevel@vger.kernel.org
Cc: Jeff Moyer <jmoyer@redhat.com>
Subject: [PATCH 3/3] filemap: don't call generic_write_sync for -EIOCBQUEUED
Date: Fri, 27 Jan 2012 16:15:49 -0500 [thread overview]
Message-ID: <1327698949-12616-4-git-send-email-jmoyer@redhat.com> (raw)
In-Reply-To: <1327698949-12616-1-git-send-email-jmoyer@redhat.com>
Hi,
As it stands, generic_file_aio_write will call into generic_write_sync
when -EIOCBQUEUED is returned from __generic_file_aio_write. EIOCBQUEUED
indicates that an I/O was submitted but NOT completed. Thus, we will
flush the disk cache, potentially before the write(s) even make it to
the disk! Up until now, this has been the best we could do, as file
systems didn't bother to flush the disk cache after an O_SYNC AIO+DIO
write. After applying the prior two patches to xfs and ext4, at least
the major two file systems do the right thing. So, let's go ahead and
fix this backwards logic.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
---
mm/filemap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index c4ee2e9..004442f 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2634,7 +2634,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos);
mutex_unlock(&inode->i_mutex);
- if (ret > 0 || ret == -EIOCBQUEUED) {
+ if (ret > 0) {
ssize_t err;
err = generic_write_sync(file, pos, ret);
--
1.7.1
next prev parent reply other threads:[~2012-01-27 21:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 21:15 [patch|rfc][0/3] fix aio+dio+O_SYNC writes Jeff Moyer
2012-01-27 21:15 ` [PATCH 1/3] xfs: honor the O_SYNC flag for aysnchronous direct I/O requests Jeff Moyer
2012-01-28 14:59 ` Christoph Hellwig
2012-01-27 21:15 ` [PATCH 2/3] ext4: " Jeff Moyer
2012-02-02 17:31 ` Jan Kara
2012-02-06 16:20 ` Jeff Moyer
2012-02-06 16:58 ` Jan Kara
2012-02-08 15:11 ` Jeff Moyer
2012-02-13 18:27 ` Jan Kara
2012-01-27 21:15 ` Jeff Moyer [this message]
2012-01-28 15:08 ` [PATCH 3/3] filemap: don't call generic_write_sync for -EIOCBQUEUED Martin Steigerwald
2012-02-02 17:52 ` Jan Kara
2012-02-06 16:33 ` Jeff Moyer
2012-02-06 19:55 ` Christoph Hellwig
2012-02-07 20:39 ` Jeff Moyer
2012-02-08 16:09 ` Jan Kara
2012-02-08 16:38 ` Jeff Moyer
Reply instructions:
You may reply publicly 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327698949-12616-4-git-send-email-jmoyer@redhat.com \
--to=jmoyer@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).