diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-09-04 09:04:40 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-04 09:23:46 -0400 |
commit | 02afc27faec94c9e068517a22acf55400976c698 (patch) | |
tree | 45de9689088ea99e1197c3f20f08cb9835a66410 /mm | |
parent | 7b7a8665edd8db733980389b098530f9e4f630b2 (diff) |
direct-io: Handle O_(D)SYNC AIO
Call generic_write_sync() from the deferred I/O completion handler if
O_DSYNC is set for a write request. Also make sure various callers
don't call generic_write_sync if the direct I/O code returns
-EIOCBQUEUED.
Based on an earlier patch from Jan Kara <jack@suse.cz> with updates from
Jeff Moyer <jmoyer@redhat.com> and Darrick J. Wong <darrick.wong@oracle.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/filemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 4b51ac1acae7..731a2c24532d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2550,7 +2550,7 @@ ssize_t generic_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
2550 | ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); | 2550 | ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos); |
2551 | mutex_unlock(&inode->i_mutex); | 2551 | mutex_unlock(&inode->i_mutex); |
2552 | 2552 | ||
2553 | if (ret > 0 || ret == -EIOCBQUEUED) { | 2553 | if (ret > 0) { |
2554 | ssize_t err; | 2554 | ssize_t err; |
2555 | 2555 | ||
2556 | err = generic_write_sync(file, pos, ret); | 2556 | err = generic_write_sync(file, pos, ret); |